Why your average cost matters
If you buy the same stock or fund several times at different prices, each purchase has its own cost. Your average cost per share (also called cost basis per share) combines them into one number: the price the stock has to reach for your whole position to break even. It is the reference for deciding whether to buy more, how far a position is from recovery and, in many cases, what gain you will report when you sell.
The formula
- Average cost = (sum of shares × price for each purchase + all fees) ÷ total shares
- Unrealized gain = total shares × current price − total cost
- Gain in % = gain ÷ total cost
The calculator accepts up to four purchases and adds a fixed fee for each one you fill in. Leave unused rows at zero.
Worked example
An investor bought the same stock three times:
| Purchase | Shares | Price | Cost |
|---|---|---|---|
| 1 | 10 | $150 | $1,500 |
| 2 | 15 | $120 | $1,800 |
| 3 | 20 | $100 | $2,000 |
| Total | 45 | $5,300 |
- Average cost = $5,300 ÷ 45 = $117.78 per share. It is not the plain average of the three prices ($123.33), because more shares were bought at the lower prices.
- At today’s price of $125, the position is worth 45 × $125 = $5,625.
- Unrealized gain: $5,625 − $5,300 = $325, or +6.13%.
Averaging down and up
Buying more after a fall lowers your average cost. That shortens the way back to break-even if the stock recovers, but it also concentrates more money in a falling position. Before averaging down, ask whether you would buy the stock today if you did not already own it. Buying at regular intervals regardless of price (dollar-cost averaging) is different: it is a plan, not a reaction.
Average cost and taxes
For mutual fund shares and dividend reinvestment plans, you can elect the average cost method on your tax return. For individual stocks, the IRS default is first in, first out (FIFO): the shares you bought first are treated as sold first, unless you tell your broker which lots to sell (specific identification). Your realized gain can therefore differ from what the average cost suggests. Commissions and fees paid to buy are part of your basis and reduce the taxable gain.
Use the capital gains tax calculator to estimate the tax on a sale.