Key facts
- Average cost = total amount invested ÷ total shares.
- Buying 100 shares at $50, 50 at $42 and 75 at $38 gives 225 shares for $9,950, an average cost of $44.22.
- To lower that average to $42 by buying at $36, you need about 84 more shares, costing $3,024.
- Shares needed = current shares × (current average − target) ÷ (target − new price).
- Averaging down only helps if the reasons you bought the stock still hold; it also increases your exposure to one company.
How to use this calculator
- Type one purchase per line: the number of shares, then the price, for example "100 50".
- Enter the current share price to see the market value and unrealized gain or loss.
- To plan a purchase, enter the price you could buy at now and the average cost you are aiming for.
- Read your average cost, total shares, total invested, and the shares needed to reach your target.
Formulas for average stock cost
Average cost = (shares₁ × price₁ + shares₂ × price₂ + …) ÷ (shares₁ + shares₂ + …)Shares to buy = S × (A − T) ÷ (T − P)S is the shares you own, A your current average, T your target average and P the price you would buy at. The target must lie between your current average and the new price.
Worked examples: average stock cost
| Purchase | Shares | Price | Cost |
|---|---|---|---|
| 1 | 100 | $50 | $5,000 |
| 2 | 50 | $42 | $2,100 |
| 3 | 75 | $38 | $2,850 |
| Total | 225 | $9,950 |
Average cost = 9,950 ÷ 225 = $44.22. With the stock at $45, the position is worth $10,125, an unrealized gain of $175 (1.76%).
To average down to $42 by buying at $36: shares = 225 × (44.22 − 42) ÷ (42 − 36) = 83.3, so 84 shares costing $3,024.
Why a simple average of prices is wrong
The average of $50, $42 and $38 is $43.33, but you bought different numbers of shares at each price, so your real cost per share is $44.22. Always weight each price by the number of shares, which is exactly what this calculator does. The idea is the same as a weighted average.
Averaging down vs averaging up
- Averaging down means buying more after the price falls, lowering your average cost. It can work well for broad index funds held for the long term. For single stocks it is riskier: a falling price may reflect real problems, and you end up with more money in a weaker company.
- Averaging up means buying more after the price rises. Your average cost goes up, but you are adding to a position that is working.
A useful rule is to decide in advance how large any single stock may become in your portfolio, and never average down beyond it.
Dollar-cost averaging
Investing a fixed amount at regular intervals, whatever the price, buys more shares when prices are low and fewer when they are high. Over time your average cost ends up below the average price over the period. It is a disciplined way to invest a monthly salary and avoids trying to time the market.
Cost basis and taxes
Your average cost is also the basis for calculating gains when you sell, though tax rules differ by country and account. In the US, brokers usually track the cost of each lot, and you can often choose which lots to sell. If you sell shares at a loss and buy the same stock within 30 days before or after, the wash-sale rule disallows the loss for now. Use the stock profit calculator to see the result of selling at a given price.
Fees
If you paid commissions, add them to the price of each purchase (fee ÷ shares) for a precise cost basis.
Average cost, cost basis and the tax lot you sell
Your average price per share is useful for judging a position, but for US taxes what matters is the cost basis of the specific shares you sell. Brokers default to first in, first out (FIFO) for stocks unless you choose another method, such as specific identification, which lets you sell the highest-cost lots first to reduce taxable gains. Mutual funds can use the average cost method, the same calculation as this calculator. Since 2011, brokers must report cost basis for stocks bought after that date to the IRS on Form 1099-B, under rules added by the Emergency Economic Stabilization Act of 2008.
Buying more after a price drop, called averaging down, lowers your average but increases how much you have riding on one company; buying on a schedule regardless of price is dollar-cost averaging. Stock splits and reinvested dividends also change the average: a 2-for-1 split doubles your shares and halves the average price without changing the total cost. Some long-term holders also sell covered call options on shares they already own to collect premium, accepting that the shares may be called away at the strike price. To see the profit at a sale price, use the stock calculator; to track dividends reinvested over time, the dividend calculator; and to compare the result with a savings account, the compound interest calculator.
How this calculator works
- Enter each purchase as shares and price (one per line).
- Total cost = Σ shares × price; total shares = Σ shares; average price = total cost ÷ total shares.
- If you enter a current price, the calculator shows market value and unrealized gain or loss.
- Averaging-down mode: given a new purchase price and a target average, it works out how many shares you would need to buy. Fees and splits must be entered as adjusted prices and shares.
Frequently asked questions
How do I calculate my average cost per share?
Add up the total amount you paid for all purchases and divide by the total number of shares.
How many shares do I need to buy to lower my average?
Shares = current shares × (current average − target) ÷ (target − new price). The new price must be below your target.
Why can’t I just average the prices?
Because you probably bought different numbers of shares each time. Each price must be weighted by the shares bought at it.
Is averaging down a good strategy?
It can work for diversified funds held long term. For a single stock, only do it if your reasons for owning it still hold and the position stays a sensible size.
What is the difference between averaging down and dollar-cost averaging?
Averaging down is buying more after a fall to lower your cost. Dollar-cost averaging is investing a fixed amount on a schedule regardless of price.
Should I include fees in my average cost?
Yes, for accuracy. Add each purchase’s fees to its cost before dividing.
Does averaging down change my break-even price?
Yes. Your break-even price before fees is your average cost, so lowering the average lowers the price you need to get back to even.
What is the wash-sale rule?
A US tax rule that disallows a loss if you buy the same or a substantially identical security within 30 days before or after selling it at a loss.