Stock Average Cost Calculator
Calculate average cost per share after purchases at different prices and quantities.
Returns cost basis and weighted average price for stocks, ETFs, and crypto.
Average Cost Per Share (also called cost basis) tells you the weighted average price you paid across multiple stock or ETF purchases. This is different from a simple average of prices, because it weights each price by how many shares you bought at it.
Formula:
Average Cost = Total Amount Invested / Total Shares Owned
Total Invested = Σ (Shares Bought × Price Per Share)
What each variable means:
- Shares: the number of shares purchased in each transaction.
- Price Per Share: the price you paid per share in that transaction.
- Current Price (optional): today’s market price, used to calculate your unrealized gain or loss.
Practical example with 3 purchases:
| Purchase | Shares | Price | Cost |
|---|---|---|---|
| 1st | 10 | $50 | $500 |
| 2nd | 20 | $40 | $800 |
| 3rd | 15 | $45 | $675 |
| Total | 45 | $1,975 |
Average Cost = $1,975 / 45 = $43.89 per share. Note: a simple average of prices ($50 + $40 + $45) / 3 = $45.00 would be incorrect because you bought more shares at the lower price.
When to use this calculator: Use it to track your cost basis for tax reporting (capital gains are calculated from your average cost), to evaluate your dollar-cost averaging strategy, or simply to know your breakeven price, which is the point where the position turns profitable.
Why it matters for taxes: When you sell shares, your taxable gain = (Selling Price - Average Cost) × Shares Sold. Knowing your exact average cost prevents you from overpaying or underpaying taxes.
Tips: Dollar-cost averaging (DCA) means investing a fixed amount on a schedule regardless of price, and it naturally lowers your average cost over time because you buy more shares when prices are low and fewer when prices are high. If you have a current price, this calculator also shows your total unrealized gain or loss and the percentage return on your investment.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.