What Is Cost Basis? Definition and Example
Cost basis is what you paid for an investment, and it decides your gain or loss when you sell. Here is how it is calculated, with an average‑cost and FIFO example.
The average cost method values every share you own at the same blended price. Here is how it works, how it compares with FIFO, and when the IRS allows it.
What is your own portfolio exposed to? Check it with Exent →
It is a way to work out cost basis when you bought the same holding at different prices. Instead of tracking each lot, you pool them. The formula:
Average cost per share = total amount paid ÷ total shares owned
Selling shares does not change the average cost of the shares that remain. Buying more does.
See how this applies to your own holdings with an Exent portfolio check.
Illustrative: you buy 10 shares at $100 and later 10 at $150. Then you sell 5 at $160.
| Method | Cost of the 5 shares sold | Gain on the sale |
|---|---|---|
| Average cost ($125 a share) | $625 | $175 |
| FIFO (oldest shares first, $100) | $500 | $300 |
In a rising market, FIFO sells the cheapest shares first and shows a bigger gain now. Average cost spreads it out.
Under IRS Publication 550, average basis is available for identical shares held with a custodian that are mutual fund shares or shares held in a dividend reinvestment plan (DRIP), within the rules described there. If you cannot identify which shares you sold and average basis does not apply, the default is FIFO. Check with your broker or a tax professional for your own situation.
For tracking performance, average cost is simple and stable: one number per holding tells you whether a position is up or down. Splits still need handling; see stock splits and cost basis.
Neither is better in general. FIFO often shows larger gains when prices have risen; average cost smooths them. For taxes, the method must follow IRS rules and your broker’s elections.
For US taxes, generally only for shares in a dividend reinvestment plan under IRS rules. Mutual fund shares also qualify. Ordinary stock lots usually use FIFO or specific identification.
No. Selling reduces the number of shares but leaves the average cost of the remaining shares unchanged.
Upload a screenshot of your holdings and get concentration, overlap, crash exposure and a risk-matched benchmark in about a minute.
Educational content, not investment advice. Examples are illustrative; past performance does not guarantee future results.