Stock Average Calculator
حاسبة متوسط سعر السهم
Enter your buy trades to get your true average cost per share with fees, your profit or loss, and the shares needed to reach a target average.
Calculated in your browser. Your data is never sent to a server.
Result
Enter the shares and buy price for each trade.
When you buy the same stock in several lots at different prices, your real cost is neither the last price nor the simple average of prices. It is the average weighted by the number of shares in each lot.
Add each trade with its shares, price and any fee. The calculator shows your average and total cost, your market value and profit or loss if you enter the current price, and the shares you need to buy to move your average.
How it works
- Cost of each trade = shares × price + fee.
- Average price = total cost ÷ total shares.
- Profit or loss = current price × shares − total cost.
- Shares for a target average = (current cost − target × current shares) ÷ (target − new price), rounded up to a whole share.
Formulas
Average = Σ(shares × price + fee) ÷ Σ sharesP/L % = P/L ÷ total cost × 100n = (C − T × S) ÷ (T − P)
C is current cost, S current shares, T target average, P new buy price. A target is only reachable if it lies between your current average and the new price.
Worked examples
Two buys at different prices
100 shares at 50 and 200 at 35: cost 5,000 + 7,000 = 12,000, average 12,000 ÷ 300 = 40, not the simple average of 42.5.
With fees
100 shares at 50 and 100 at 30, with a 15 fee per trade: cost 8,030 and an average of 40.15 instead of 40.
Current loss
300 shares at an average of 40 with the price now 36: value 10,800, a loss of 1,200 or 10%; the stock must rise 11.11% to get back to your average.
Averaging down
300 shares at 40, aiming for 36 by buying at 30: you need 300 × 4 ÷ 6 = 200 shares costing 6,000, giving 500 shares at 36.
Frequently asked questions
Why not just average the prices?
Because each trade has a different number of shares. A simple average gives a small trade the same weight as a large one and misstates your real cost.
Should I include fees?
Yes, they are part of your real cost, and some brokers include them in the average shown in your portfolio. The calculator shows the average with and without fees.
Is averaging down a good idea?
It lowers your break-even price but increases your exposure to a falling stock. The calculator gives you the numbers; the decision depends on your analysis and risk management.
What about bonus shares and splits?
Add bonus shares as a trade at price 0 and the average drops automatically. For a split, multiply your shares by the ratio and divide the price by it.
Does it show market prices?
No. Enter the current price from your trading platform; we show no live prices and give no recommendations.
Content last reviewed: November 2, 2026
