Cost basis: the number that decides your tax bill when you sell
The IRS doesn't tax what you sold — it taxes the difference between sale price and basis. What adjusts it, how lot selection works, and the inheritance rule that erases decades of gains.
When you sell an investment, the IRS doesn't care what you sold it for — it cares about the gap between the sale price and your cost basis: what you paid, adjusted for a handful of events along the way. Basis is the denominator of every capital gains calculation, and misunderstanding it leads to the two classic errors — paying tax twice on the same dollars, or drastically underestimating a tax bill.
The basic math
Buy 100 shares at $40 — your basis is $4,000 (plus any commission). Sell them later for $7,000, and your taxable gain is $3,000, not $7,000. Simple — until real life adjusts the number. Reinvested dividends raise your basis (you paid tax on them as income, so they're new money invested). Stock splits spread the same basis across more shares. Home improvements raise a house's basis; depreciation deductions on a rental lower it.
Lots: you choose which shares you sell
Every separate purchase creates a tax lot with its own basis and its own holding-period clock. When you sell part of a position, the default at most brokerages is FIFO — first in, first out — which sells your oldest (usually lowest-basis, biggest-gain) shares. But you're allowed to specify lots at or before the sale, and the choice changes the bill.
- FIFO — oldest shares first. Simple, often the biggest taxable gain.
- Specific identification — you pick the lots. Maximum control: sell high-basis lots to minimize gains, or low-basis lots in a 0%-bracket year on purpose.
- Average cost — one blended basis per fund, common as a mutual fund default. Convenient, irrevocable once used for a holding, and it forfeits lot-picking.
- Set your preference in the brokerage settings before you sell — after settlement, the choice is locked.
The step-up: the most generous rule in the code
When you inherit an asset, its basis resets — 'steps up' — to its market value on the date of death. A parent's $30,000 of stock that grew to $400,000 passes to you with a $400,000 basis; sell it the next week and the taxable gain is roughly zero. Decades of appreciation, never taxed. This is why the standing advice for elderly holders of huge embedded gains is often to hold, and why gifting appreciated assets during life (which transfers the old basis to the recipient) can be a five-figure mistake compared to leaving them.
Keeping basis clean
- Check that every holding in your taxable account shows a basis in your brokerage — chase down any marked 'unknown' or 'not provided.'
- Save year-end statements (or the 1099-B and its supplemental pages) — they carry the lot detail.
- Homeowners: keep receipts for improvements — a new roof, remodel, or addition raises your home's basis and shrinks a future gain beyond the $250k/$500k exclusion.
- Before any partial sale, review your lots and pick deliberately instead of accepting FIFO.
- If you inherit assets, record the date-of-death values immediately — that single note is the whole tax story later.
One position, three ways to sell it
| Lot sold | Purchase | Basis in sale | Taxable gain | Character |
|---|---|---|---|---|
| FIFO default: 2018 lot | $8,000, seven years ago | $8,000 | $7,000 | Long-term — biggest gain |
| Specific ID: 2024 lot | $13,000, eighteen months ago | $13,000 | $2,000 | Long-term — smallest bill |
| Specific ID: this year's lot | $14,500, four months ago | $14,500 | $500 | Short-term — small but at income rates |
The table shows a $5,000 swing in reported gain from a single dropdown selection at the moment of sale — same fund, same proceeds, same day. In the 15% bracket that is $750 of tax determined purely by lot choice, and the choice compounds across a lifetime of partial sales. It also runs in reverse: in a year when you want gains (to fill the 0% bracket) or losses (to harvest against other gains), specific identification is the steering wheel. This is also where basis meets the wash-sale rule — harvest a loss and repurchase the identical fund within 30 days, and the loss is disallowed, with the denied amount added to the new shares' basis. The system remembers; the records just have to.
Homeowners deserve their own worked example, because home basis is the most under-documented number in personal finance. Buy at $320,000, add a $60,000 remodel, $18,000 roof, and $12,000 HVAC over the years, and sell at $700,000: with receipts, your basis is $410,000 and the $290,000 gain fits entirely inside the $250,000/$500,000 home-sale exclusion for most married couples — tax owed, zero. Without receipts, basis is $320,000, the gain is $380,000, and a single filer owes 15% on $130,000: nearly $20,000 for a folder of paperwork that no longer exists. Keep a running file (or even a spreadsheet with photos) of every improvement; it is the cheapest tax preparation you will ever do, decades in advance.
The bottom line
Cost basis is the tax system's memory of what you already paid. Reinvested dividends raise it, depreciation lowers it, inheritance resets it, and lost records default it to zero — always in the IRS's favor. Keep the records, pick your lots, and remember the asymmetry: basis mistakes never overcharge the government, only you.
Check your understanding
1 of 3Not quite — try again.
Get smarter about money every week
One email, no spam — practical guides and Worth updates. Unsubscribe anytime.
Put this into practice
Worth tracks your accounts, budgets, and goals — so the concepts in this article aren't just theory.
Start free trial