Few investors buy a stock just once. Most build a position gradually, adding shares at different prices over months or years. So the real question becomes: what’s your actual average cost, and where does the stock need to trade for you to break even? Here’s the math.
The Weighted Average Cost Formula
Average Cost Per Share = Total Amount Invested ÷ Total Shares Owned
This weights each purchase by how many shares it involved, not by treating every purchase price equally regardless of size.
Real Example: Three Purchases at Different Prices
Let’s calculate a full position built over time.
- Purchase 1: 50 shares at $120 = $6,000
- Purchase 2: 30 shares at $95 = $2,850
- Purchase 3: 40 shares at $110 = $4,400
Total shares: 50 + 30 + 40 = 120
Total cost: $6,000 + $2,850 + $4,400 = $13,250
Average cost per share: $13,250 ÷ 120 = $110.42
Notice this average sits closer to the two larger purchases ($120 and $110) than to the smaller $95 purchase, which is exactly what a weighted average should do. A simple, unweighted average of the three prices would incorrectly suggest $108.33, ignoring how many shares each price actually applied to.
Why Average Cost Matters for Break-Even
Your average cost per share is the exact price the stock needs to reach for your position to break even, before accounting for any dividends received or trading fees paid. In this example, if the stock currently trades at $115, the position shows an unrealized gain of $4.58 per share, or $549.60 total across all 120 shares.
Averaging Down vs Averaging Up
- Averaging down means buying more shares after the price drops, which lowers your average cost but also increases your total exposure to a stock that’s currently underperforming
- Averaging up means buying more shares as the price rises, which raises your average cost but reflects growing conviction in a stock that’s proving out your original investment thesis
Neither strategy is universally correct. Investopedia’s analysis of averaging down notes it can work well for genuinely undervalued, high-conviction positions, but can also compound losses significantly if the original investment thesis was simply wrong rather than the stock being temporarily undervalued.
Average Cost and Your Tax Basis
Your average cost per share becomes your cost basis for tax purposes when you eventually sell. Capital gains or losses get calculated against this basis, not against any single individual purchase price. For investors using specific identification rather than average cost accounting, the IRS also allows choosing which specific shares (and their original purchase price) to sell, which can meaningfully affect the resulting tax bill. The IRS’s guidance on cost basis methods explains the different methods available and how to elect between them.
Dividend Reinvestment Complicates the Math
If dividends were automatically reinvested into additional shares, each reinvestment counts as its own separate purchase, adding another line to the weighted average calculation. Over years of consistent dividend reinvestment, a position can end up with dozens of individual purchase records, each needing to be tracked for accurate average cost and tax basis calculations. Most brokerages track this automatically today, but manually verifying the calculation occasionally is still worth doing.
Common Average Cost Mistakes
- Using a simple average instead of a weighted average, which produces an inaccurate result whenever purchase sizes differ
- Forgetting to include trading commissions in the total cost, when they apply
- Not accounting for stock splits, which change both share count and per-share price retroactively for all prior purchases
- Ignoring reinvested dividends when calculating true average cost and tax basis
Calculate your exact average stock cost. Use the Stock Average Calculator →
Frequently Asked Questions
How do you calculate average stock price with multiple buys?
Multiply each purchase’s share count by its price, add all those totals together, then divide by the total number of shares owned across all purchases. This weighted approach accurately reflects purchases of different sizes.
Does average cost change when I sell shares?
No, selling shares doesn’t change your average cost basis for the remaining shares under standard average cost accounting, though your total position size and total invested amount both decrease proportionally.
What is the difference between average cost and cost basis?
They’re closely related. Average cost per share is the calculation itself, while cost basis is the broader tax term referring to your original investment amount used to calculate capital gains or losses when you eventually sell.
Should I average down on a losing stock?
It depends entirely on whether your original investment thesis still holds. Averaging down can work well for a genuinely undervalued stock, but can also meaningfully compound losses if the stock is declining due to a real, ongoing business problem.
How do stock splits affect average cost calculations?
A stock split adjusts both your share count and per-share price proportionally, so your total cost basis stays the same even though the individual numbers change. For example, a 2-for-1 split doubles your shares while halving your per-share cost basis.
Do reinvested dividends count toward average cost?
Yes, each dividend reinvestment purchases additional shares at that day’s price, and this counts as its own purchase in the weighted average calculation, meaning consistent dividend reinvestment can meaningfully shift your overall average cost over time.