Cost basis is the number the IRS uses to decide how much of your sale was profit. Get it wrong and you can pay tax twice — once on dividends already taxed, again on artificially inflated gains.
The Definition
Cost basis = what you paid for the shares, including commissions. It is set the day you buy, and it follows that lot until you sell it.
Multiple Lots
If you bought 100 shares at $50, then 50 more at $60, your average cost basis is ($5,000 + $3,000) / 150 = $53.33 per share. Our Stock Cost Basis Calculator handles unlimited lots, including commissions per lot.
Cost Basis Methods
When you sell partial shares, the broker has to decide which lots you sold:
- Average cost — common for mutual funds, simple to track.
- FIFO (first-in, first-out) — the default for most stocks.
- Specific identification — you tell the broker exactly which lots to sell, useful for tax-loss harvesting.
DRIP Complicates It
Every reinvested dividend creates a new tax lot at that day's price. Over 10 years you might have 40+ lots in one position. Most brokers track them automatically — but verify before you sell, because their numbers occasionally drift.
Stock Splits Don't Change Total Basis
A 2-for-1 split doubles your share count and halves your per-share basis. Total cost basis stays the same. Reverse splits work the opposite way.
Bottom Line
Always have an accurate basis before selling, especially if you have decades of DRIP. Misreported basis is one of the most common — and expensive — investing mistakes.
Frequently Asked Questions
What is cost basis and why does it matter?
Cost basis is the amount you paid for an investment, including commissions, and it's the figure the IRS uses to determine your taxable gain or loss when you sell. Getting cost basis wrong can lead to overpaying or underpaying taxes, in some cases even paying tax twice on the same income. Because of this, keeping accurate basis records is generally considered essential, especially for positions held over many years.
How is cost basis calculated when you buy shares at different prices over time?
When multiple purchases ("lots") occur at different prices, your average cost basis is the total dollars invested divided by the total shares owned — for example, buying 100 shares at $50 and 50 more at $60 gives an average basis of about $53.33 per share. Brokers may also use methods like FIFO (first-in, first-out) or let you specifically identify which lots to sell, which matters especially for tax-loss harvesting. Reviewing your broker's cost-basis method before selling is generally a good practice.
Does reinvesting dividends complicate my cost basis?
Yes — each reinvested dividend purchase creates a brand-new tax lot at that day's share price, so a position held for a decade with dividend reinvestment can accumulate dozens of separate lots, each with its own basis. Most brokers track this automatically, but it's worth double-checking their figures before selling, since discrepancies do occur. This complexity is one reason cost-basis tracking tools can be useful for long-term dividend investors.
Run the numbers yourself
Plug your own inputs into our free calculators — no signup.