CalcGallery

Stock Average Calculator

Your average cost per share across several purchases, what the holding is worth now, and how many more shares at a new price would move the average to a target.

Built by AbhiLast reviewed September 25, 2026

First buyLast buy

Your amounts and assumptions

Row 1
Row 2
Row 3

One row for each buy: how many shares and the price paid for each.

Added to the cost of the shares.

Enables the value and gain or loss.

With a target average, works out how many shares to buy.

The average you want after that purchase.

Result

Average cost per share: $38.33

On the purchases you enter, all still held. It does not decide which shares a sale would come from.

Total shares
300
Total cost
$11,500.00
Report a problem with this calculator
Your entries are kept on this device only.

Results are arithmetic on the returns, rates and horizons you enter, not a forecast and not investment, tax or retirement advice. The site supplies no expected return, inflation rate, contribution limit, tax rate or withdrawal rate. Real returns vary from year to year, and fees, taxes and the order of returns all change the outcome. Check anything that matters with a qualified adviser. Read the full disclaimer

How to use the Stock Average Calculator

  1. Add a row for each purchase with the number of shares and the price paid per share.
  2. Optionally add the commissions you paid, and today's price to see the gain or loss.
  3. To plan a further purchase, enter its price and the average you want to reach.

The formula

average cost = (shares₁ × price₁ + shares₂ × price₂ + … + commissions) ÷ total sharesshares to reach a target = shares held × (average − target) ÷ (target − new price)

Averaging down gets harder as you go

Each share bought below your average pulls it down, but every new share is diluted by all the ones already held, so each step towards the target costs more than the last. Close to the new price, the shares needed grow without limit, which is why the target must sit strictly between the new price and your current average. Whether buying more is wise depends on why the price fell, which the arithmetic cannot tell you.

What the diagram shows

The price of each purchase in order, with your average cost as a dashed line. The line sits closer to the prices where you bought the most shares.

With your numbers

  1. Total cost = 100 × $50.00 + 50 × $40.00 + 150 × $30.00 + $15.00 commissions = $11,515.00
  2. Average cost = $11,515.00 ÷ 300 shares = $38.38
  3. Shares to buy = 300 × ($38.38 − $35.00) ÷ ($35.00 − $28.00) = 145

Quick reference

On the purchases you enter, all still held. It does not decide which shares a sale would come from.

Worked examples on the assumptions shown, for United States. None of these rates is a forecast or a recommendation.
ExampleAverage cost per share
100 at 50, 50 at 40, 150 at 30$38.33
Same, with 15 of commissions and a price of 42$38.38
Average down to 35 buying at 28$38.33
Two equal buys at 20 and 30$25.00
Equal money at 20 and 30$24.00
Fractional shares at 3,200 and 2,800$3,066.67

Common questions about the Stock Average Calculator

Why is my average not the average of the prices?
Because each price counts as many times as the shares bought at it. Ten shares at 20 and ten at 30 average 25, but fifteen at 20 and ten at 30, the same 300 spent twice, average 24. The page weights every price by its shares.
Should commissions be included?
They are part of what the shares cost you, so they are added to the total cost and raise the average. Leave the field blank to see the average of the prices alone.
How many shares do I need to buy to lower my average?
Enter the price you expect to pay and the average you want. The page solves shares × (current average − target) ÷ (target − new price). The target has to sit between the new price and your current average: buying at 28 can pull an average down towards 28, never below it.
Does this give my cost basis for tax?
It gives the average cost of everything you hold. When you sell only part of a holding, the tax rules where you live decide which shares were sold, first in, specific lots or an average, and the answer can differ. Check those rules, or ask whoever keeps your tax records.

Report a problem with this calculator