Stock Average Calculator

Your average cost per share over many buys — and how many shares at a new price bring the average to a number you choose.

100% private — runs entirely in your browser. Your data is processed on your device and never sent to the internet.

Everything is worked out in your browser and saved only on this device. Nothing you type is sent anywhere.

About the stock average calculator

When you buy the same stock several times at different prices, your average cost per share is what one share really cost you. This free stock average calculator works it out from all your buys, with fees included.

Type the shares and the price per share of each buy, and the fee if you paid one. You get the average cost per share, the total shares and the total cost.

The second part answers a common question: *"How many shares must I buy at today's price to bring my average to a number?"* Type the price of the new buy and the average you want, and the calculator gives the number of shares and what that buy costs.

This page does math only. It never looks up prices, and it does not tell you whether to buy.

Features

  • Average cost per share — over up to 50 buys
  • Fees counted — a fee per buy, added to the cost; the average without fees is shown too
  • Shares for a target average — how many shares at a new price bring the average to your number, also in whole shares
  • Average up or down — works for buying below the average and above it
  • What-if table — the new average after buying more shares at the new price
  • Gain or loss — type the price now to see the value and the gain or loss, in money and percent
  • Any currency, any asset — shares, funds or anything else bought per unit

How the average cost is worked out

Average cost per share = total cost ÷ total shares. The total cost is every buy's shares × price, plus the fees.

The page opens with two buys:

  • 10 shares at $150 = $1,500
  • 20 shares at $120 = $2,400
  • Total: 30 shares for $3,900, so the average is 3,900 ÷ 30 = $130.00 a share

It is not the middle of the two prices ($135), because you bought more shares at the lower price.

With fees: 50 shares at $40, 30 at $32 and 20 at $28, with a $5 fee on each buy. The shares cost $3,520 and the fees $15, so the average is 3,535 ÷ 100 = $35.35 — without the fees it would be $35.20.

How many shares to reach an average

Shares to buy = (average you want × shares now − cost now) ÷ (new price − average you want)

With the 30 shares at $130 above, and a new buy at $100:

  • To bring the average to $120: (120 × 30 − 3,900) ÷ (100 − 120) = 15 shares, which cost $1,500
  • To bring it to $125: (125 × 30 − 3,900) ÷ (100 − 125) = 6 shares, which cost $600

And the average after other buys at $100:

More shares at $100New average
8$123.68
15$120.00
30$115.00
60$110.00

The average can only move toward the new price — it never reaches it. To bring the average down, the new price must be below the average you want. To bring it up, it must be above: 15 shares at $160 raise the $130 average to $140.

Frequently asked questions

How do I calculate my average share price?

Add up what you paid for all the shares (with fees) and divide by the number of shares. 10 shares at $150 and 20 at $120 cost $3,900 for 30 shares: $130 a share.

Should fees be included?

For your real cost, yes — a fee is part of what you paid. Type each buy's fee and the calculator adds it. The result also shows the average without fees, which is what many apps show as the "average price".

Why can I not reach my target average?

The new buy pulls the average toward its own price. If the new price is above the average you want (when you want it lower), no number of shares can get there. The calculator then says what the new price must be.

Does selling change my average cost?

Not with the average cost method: selling some shares leaves the average cost per share of the rest the same. Tax rules for cost basis differ between countries (some use first-in, first-out), so check yours for tax returns.

Can I use it for funds, crypto or other assets?

Yes. The math is the same for anything you buy per unit. Shares can have decimals for fractional shares.

Is averaging down a good idea?

This calculator does not answer that. It only shows the math. Averaging down also puts more money into the same investment.

Related tools

How to use it

  • Type the shares and the price per share of your first buy, and the fee if there was one
  • Press Add another buy for each other buy
  • Read the average cost per share, the total shares and the total cost
  • Under Bring the average to a number, type the price of the new buy and the average you want
  • Read how many shares to buy, in whole shares too, and what the buy costs
  • Open More options to add a fee on the new buy, or the price now to see your gain or loss

We add new tools regularly — subscribe on YouTube to be notified when each one goes live.

More tools

View all

Recommended Apps

View all