Stock average calculator
Type each purchase: the number of shares and the price paid. The page shows your average cost per share and the total. Below, see what one more purchase does to the average, or how many shares at a given price bring it to the figure you type.
Your average cost
| Purchase | Shares | Price | Cost |
|---|
With one more purchase
| Case | Shares then | Average then | Total cost then |
|---|
A lower average is not a smaller loss: each added share is more money exposed to the next move.
3 · How it is calculated
Runs in your browser. Nothing you type leaves this page.
Average cost = everything paid, fees included, divided by the shares held. Exact to the cent; the average is rounded once, at 4 decimals.
This calculator does not know your broker, account type, tax position or fees.
Cost basis for tax can differ: brokers often match sales to particular purchases (first in, first out, or lots you pick) instead of the average.
How to read these numbers: what they mean, the formula in plain words, a worked example, the common mistake and the conventions.
How to read the result
Average cost per share, in five parts
What the numbers mean
Your average cost is the price at which the whole position is at zero: above it the shares are worth more than you paid, below it less. Each new purchase pulls the average toward its own price, more strongly the more shares it adds.
The formula, in plain words
Add up what each purchase cost (shares times price), add the fees, and divide by all the shares. To reach a chosen average with one more purchase, the shares needed are the gap between what you paid and what that average would have cost, divided by how far the new price sits from that average.
One worked example
The calculator's starting inputs: 100 shares at 50.00 and 50 at 42.00, no fees.
- Total cost100 × 50.00 + 50 × 42.00 = 7,100.00
- Average cost7,100.00 / 150 ≈ 47.3333
- 25 more at 38.00(7,100.00 + 25 × 38.00) / 175 = 46.00
- Shares to average 45.00(7,100.00 − 45.00 × 150) / (45.00 − 38.00) = 50
The common mistake
Reading a lower average as a smaller loss. In the example, adding 50 shares at 38.00 brings the average to 45.00, but the position grows from 150 to 200 shares. A further fall of 4.00 a share then costs 800.00 instead of 600.00.
Conventions
- Fees: typed fees are added to the cost, so they raise the average. Fees of a further purchase are not included.
- Shares: whole or fractional, up to 4 decimals. The shares needed to reach an average are whole shares, rounded up.
- Part of a position closed: closing some shares does not change the average cost of the rest. Your broker's tax lots (first in, first out, or chosen lots) can show a different basis.