Stock Average Price Calculator
Work out the average buy price across several purchases with fees, the profit at today's price and shares needed to reach a target.
| Shares | Price per share | Fee for this purchase | |
|---|---|---|---|
Worked example (default values)
Inputs: Current market price = 85; Target average price = 90; Price you would buy more at = 80; Purchases: 3 row(s).
Results: Total shares = 300; Total invested (without fees) = 28,750.00; Fees = 15.00; Average price (without fees) = 95.8333; Average price (with fees) = 95.8833; Market value = 25,500.00; Unrealised profit / loss = -3,265.00; Return = -11.35 %; Shares to buy to reach target = 177; Cost of those shares = 14,160.00.
Formula
Average price = sum(shares x price) / sum(shares). With fees: (sum(shares x price) + fees) / shares. Shares n to reach target T when buying at price P: n = (cost - T x shares) / (T - P).
Assumptions and limits
- Fees are added to cost; later purchases are not assumed to have fees.
- Whole shares only for the target calculation (rounded up). Taxes are not included.
- Results are estimates for planning. They are not financial, tax or legal advice.
About Stock Average Price Calculator
Bought the same share several times at different prices? The Stock Average Price Calculator works out your average cost per share, with and without fees, your profit or loss at today's price, and how many shares to buy to reach a target average.
Add every purchase
Enter the shares, price and fee for each buy. Add or remove rows as you need.
Fees count
Each fee is added to its own purchase, so your real average is slightly above the plain average.
Reach a target average
Enter a target and a buying price, and the tool tells you how many more shares you need. It warns you if the target cannot be reached at that price.
Think before averaging down
Buying more after a fall lowers your break-even price, but puts more money into the same share. Make sure the reason you bought it still holds.
What it does not cover
Sales, dividends, stock splits, currencies and tax lots. Not financial or tax advice.
Private
The calculation runs in your browser. Nothing you type is uploaded.
What is cost basis?
Cost basis is what you paid for your shares, including fees. It is used to work out your gain or loss, and any tax on it, when you sell.
How to use Stock Average Price Calculator
- Enter each purchase as shares, price per share and fee; use Add row for more.
- Optionally enter today's price, a target average and the price you would buy more at.
- Read the average price with and without fees, the profit or loss and the shares needed.
- Press Copy result if you want the figures, or Reset to example values to start again.
For information only, not investment advice. Investments can go down as well as up, and past results do not guarantee future results.
Help & FAQ
How is the average price calculated?
Total cost divided by total shares: the sum of shares times price, divided by the sum of shares. With fees, the fees are added to the cost first.
Why are there two averages?
One ignores fees, 95.8333 in the example, and one includes them, 95.8833. The second is your true cost per share.
How is the unrealised profit worked out?
Market value minus total cost with fees. In the example 300 shares at 85 are worth 25,500 against a cost of 28,765, a loss of 3,265 or -11.35 percent.
How many shares do we need to reach a target average?
n = (cost - target x shares) / (target - buying price), rounded up. For target 90 and buying price 80 that is 176.5, so 177 shares.
Why do we get a message about the target?
The target must be below your current average and the price you buy at must be below the target. Otherwise buying more cannot reach it.
Does the target calculation include fees on the new shares?
No. The page assumes later purchases have no fee, so with brokerage you need slightly more shares.
Does it round the shares?
Yes, up to whole shares for the target calculation. The purchase table accepts fractions of a share.
Can we leave the market price empty?
Yes. The market price, target and buying price are optional. Without a market price the profit and return are not shown.
Does it handle selling or dividends?
No. It covers purchases only. For partly sold holdings, enter only the shares you still hold at their original prices.
Is averaging down a good idea?
The calculator does not say. It lowers your average cost but adds more money to the same share. This is not financial advice.
Can we use any currency?
Yes. The numbers are plain, so use one currency for all rows and enter fees in the same currency.
Is our data uploaded?
No. All calculations run in your browser.