Calculators
Stock Average Calculator
Add each buy to get your average share price, with or without fees. Find how many shares to buy to reach a target average, and see profit or loss on a partial sale or at today’s price.
Average cost per share
45.00
Total shares
200
Total cost
9,000.00
Break-even price: 45.00 per share (before fees)
For information only, not investment advice. Your entries are saved in this browser only; nothing is sent anywhere.
Works in your browser. No account needed.
Frequently asked questions
How do I calculate my average share price?
Multiply the shares by the price for each buy, add those amounts together, and divide by the total number of shares. For example, 100 shares at 50 (5,000) plus 100 shares at 40 (4,000) is 9,000 for 200 shares, so the average is 45.00. This is a weighted average: a bigger buy moves it more than a small one.
How many shares do I need to buy to average down?
Shares to buy = shares held × (current average − target) ÷ (target − new price). If you hold 200 shares averaging 45 and the stock is at 35, reaching an average of 40 takes 200 × 5 ÷ 5 = 200 shares, costing 7,000. For a target of 38 the answer is 466.67 shares. In whole shares that means 467 shares for 16,345, which gives an average of 37.9985. The Target average tab does this calculation and also works for averaging up.
Why does it say my target average can’t be reached?
Each new share pulls your average toward the price you pay, but the average never reaches or passes that price. So the target must lie strictly between the new buy price and your current average. With an average of 45 and a buy price of 35, a target of 35 or 34 is impossible. Buying at 50 can never bring a 45 average down to 40.
How are fees included?
With “Include trading fees” ticked, each buy row gets a fee. You can enter it as a flat amount per trade or as a percentage of that trade’s value. Two buys (100 at 50 and 100 at 40) with a flat fee of 5 each cost 9,010, so the average is 45.05 including fees and 45.00 excluding them. At 0.1% instead, the fees are 9 and the average is 45.045. The break-even price shown includes buy fees but not the fee you will pay when selling.
What happens to my average cost when I sell part of my shares?
Under the average-cost method this tool uses, nothing: the shares you keep have the same average cost. The sold shares are charged at that average. Selling 50 of 200 shares averaging 45 at a price of 55 gives a realized profit of 500 (+22.22%), and 150 shares remain at 45 with a cost of 6,750. Your broker or tax rules may use FIFO or specific lots instead, which would give a different realized figure.
How is unrealized profit or loss calculated?
Market value is total shares × current price, and unrealized P/L is market value minus your total cost (including buy fees if you entered them). With 200 shares costing 9,000 and a current price of 48, the market value is 9,600 and the unrealized profit is +600, or +6.67%. Selling fees are not deducted.
Can I use it for average saham, lots, crypto or fractional shares?
Yes. The math is the same for any asset bought in several purchases. Enter share counts rather than lots: on the Indonesian exchange 1 lot is 100 shares, so 5 lots is 500. Fractional amounts such as 2.5 shares or 0.014 BTC work, and a decimal comma (12,75) is accepted too. No currency is assumed.
Is my data saved or uploaded?
Your entries are saved in this browser’s local storage, so they are still there when you come back. Nothing is sent to a server. “Clear all” empties the buy rows and the other fields.
About this tool
This stock average calculator works out the weighted average cost per share of a position built from several purchases. Add as many buy rows as you need, each with a share count and a price. The tool adds up shares × price for every row and divides by the total shares. It shows total shares, total cost and average cost per share, and updates as you type. Because the average is weighted by size, 10 shares at 100 plus 90 shares at 50 average 55.00, not the 75 you would get by averaging the two prices.
Trading fees are optional. Tick “Include trading fees” and each buy gets a fee, entered either as a flat amount per trade or as a percentage of the trade value. The fees are added to the total cost, and the average is shown both including and excluding fees. With a flat fee of 5 on each of the two buys above, the total cost is 9,010 and the average is 45.05, or 45.00 before fees. The break-even price uses the fee-inclusive average but does not include the fee on a future sale.
The Target average tab answers the averaging-down question in reverse. Enter the shares you hold, your current average, the price you can buy at now and the average you want. The tool returns shares to buy = held × (average − target) ÷ (target − price), along with their cost and the position afterwards. When the answer is fractional it also gives the whole-share count, rounded up so the target is actually reached, and the average that count produces. Holding 200 shares at 45, you need 200 more at 35 to reach 40, or 467 to reach 38 (average 37.9985). If the target is at or beyond the buy price, or the buy is on the wrong side of your average, the tool explains why it can’t be reached instead of showing a meaningless number. The same formula covers averaging up, for example 100 shares at 20 plus 100 at 30 averages 25.
Two optional fields complete the picture. Enter the current market price to see unrealized profit or loss in money and percent against your total cost. Enter a number of shares to sell and a sell price (plus a sell fee if fees are on) to see the realized profit or loss, the shares left and their cost. The average-cost method is used, so a partial sale leaves the average cost of the remaining shares unchanged. You cannot sell more shares than you hold. Your entries are kept in your browser’s local storage between visits and are never uploaded. The results are for information only and are not investment or tax advice.