Stock Cost Basis Calculator
Average cost basis across multiple buy lots, with an optional stock-split adjustment.
🔒 Runs entirely in your browser — nothing here is ever uploaded
About the Stock Cost Basis Calculator
Computes your average cost basis per share across multiple buy lots at different prices and quantities — optionally adjusting for a stock split — then computes realized gain or loss on a sale using that blended average cost, the 'average cost method' some brokerages and countries require in place of FIFO or specific-lot identification.
- Enter each buy lot's price per share and quantity.
- If a stock split happened, toggle it on and enter the split ratio.
- Enter the number of shares sold and the sale price per share.
- Read your average cost basis per share, realized gain/loss, and remaining cost basis.
Lot 1: 10 shares at $100 ($1,000). Lot 2: 20 shares at $130 ($2,600). Total: 30 shares, $3,600 cost, $120/share average. Selling 15 shares at $150: $2,250 proceeds, $1,800 cost basis sold, $450 realized gain, leaving 15 shares with $1,800 remaining cost basis.
This models the average cost method only, not FIFO or specific-lot identification. Canada's CRA requires average cost (adjusted cost base) for identical publicly traded securities; the U.S. IRS defaults to FIFO but permits specific-lot identification if elected. Check which method actually applies to your country, account type, and brokerage before relying on this for a tax filing. Not tax or investment advice.
- • A stock split never changes your total cost basis — it only redistributes it across more (or fewer) shares.
- • If a split happened between some of your lots but not others, enter the earlier lots' price and quantity already split-adjusted yourself.
- • Average cost is a pooled method: it doesn't matter which literal shares you sell, only how many.
- Investopedia — Average Cost Basis Method — accessed 2026-08-31
- WealthNorth — Adjusted Cost Base (ACB) in Canada — accessed 2026-08-31
Illustrative estimate only, not financial or tax advice. Verify figures with a licensed adviser or your local tax authority.