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.

Run the numbers yourself

Plug your own inputs into our free calculators — no signup.

Browse calculators →
S

Editorial Team

Investment calculators & education

Share X f in