What Is Cost Basis?
Cost basis is the original value of an investment for tax purposes, typically the purchase price plus commissions and fees. When you sell an investment, your capital gain or loss is calculated by subtracting the cost basis from the sale price. An accurate cost basis ensures you pay the correct amount of capital gains tax, no more and no less.
Cost basis becomes more complex when you make multiple purchases at different prices (dollar-cost averaging), receive stock dividends, undergo stock splits, or reinvest distributions. This calculator helps you determine your cost basis using the most common methods: average cost, FIFO, and specific lot identification.
A wrong cost basis directly causes you to pay incorrect taxes. If your actual cost basis is $47.33 but you report $45.00, you will pay tax on an extra $2.33 per share of phantom gain. On 150 shares at 15% tax rate, that is an extra $52 in unnecessary taxes.
Cost Basis Calculation Methods
- 1Total cost = (100 × $45) + (50 × $52) = $4,500 + $2,600 = $7,100
- 2Total shares = 100 + 50 = 150
- 3Average cost basis = $7,100 / 150 = $47.33 per share
- 4FIFO basis (first lot sold first) = $45.00
- 5LIFO basis (last lot sold first) = $52.00
- 6If selling 50 shares at $55:
- 7 Average method: Gain = ($55 - $47.33) × 50 = $383.50
- 8 FIFO method: Gain = ($55 - $45) × 50 = $500
- 9 LIFO method: Gain = ($55 - $52) × 50 = $150
Cost Basis Methods Compared
| Method | How It Works | Best For | IRS Rules |
|---|---|---|---|
| Average Cost | Total cost / total shares | Mutual funds, simple tracking | Allowed for mutual funds; brokers may offer for stocks |
| FIFO (First In, First Out) | Oldest shares sold first | Default method if none specified | IRS default for stocks |
| LIFO (Last In, First Out) | Newest shares sold first | Minimizing gains when recent buys are higher | Must specify; not default |
| Specific Lot ID | You choose which shares to sell | Maximum tax flexibility | Must identify at time of sale |
How to Track Cost Basis
- Brokers report cost basis to the IRS for stocks purchased after 2011
- Reinvested dividends increase your cost basis (reducing future taxable gains)
- Stock splits change shares and per-share basis but not total basis
- Gifted stock: basis is the donor's cost basis (carryover basis)
- Inherited stock: basis is the fair market value at date of death (step-up)
- Wash sale adjustments add disallowed losses to the replacement stock's basis
If you reinvested $640 in dividends over 3 years, those reinvestments are additional purchase lots that increase your total cost basis. Failing to include them means you pay tax on gains you never actually received. This is one of the most common cost basis errors.