What the Stock Average Calculator does
This calculator works out your average buy price for a share you bought in several lots, the break-even price you need to sell at once brokerage and other charges are included, your profit or loss at today's price, and how many more shares you would have to buy at a given price to bring the average down - or up - to a target. If a target cannot be reached at that price, it says so instead of showing a meaningless number.
The average is a weighted one: each purchase counts in proportion to how many shares it bought, so 100 shares at 250 and 50 at 200 average 233.33, not 225. Charges are whatever you type from your contract note - a percentage of the trade value, a flat amount per order, or an exact figure for one purchase - because they differ by broker, exchange and country. Nothing is looked up and nothing you enter leaves the page.
How to use it
- Enter each purchase of the same share: the price you paid and the number of shares. Add rows for further buys; the order does not change the average.
- Open "Brokerage, taxes and other charges" if you want them included. Enter the percentage of trade value and any flat fee per order for buying and for selling, or type an exact charge on a purchase row to override the rule for that row.
- Type the current market price to see your profit or loss and how far the price is from your average.
- To average down, enter the average you are aiming for and the price you would buy at (it defaults to the current price). The tool gives the number of shares, rounded up to whole shares, the money needed and the new average.
- Copy the summary, download the purchase table as CSV, or print it.
Reading the results
Average buy price is the money spent on shares divided by the number of shares. Average cost includes the buy charges and is the figure to compare with the market price when charges are significant.
Break-even is the sale price at which, after the selling charges are taken off, you get back exactly what you paid in total. Below it you lose money even if the price is above your average buy price.
Buying at a price can only pull the average towards that price, never past it. If your average is 233 and the share now trades at 210, no number of shares will bring the average below 210 - so a target of 205 is refused with the reason. The closer the target is to the current price, the more shares it takes, rising steeply.
Worked example: averaging down a share that has fallen
You bought 100 shares at 250 and another 50 at 200. Shares cost 100 × 250 + 50 × 200 = 35,000 for 150 shares, so the average is 35,000 ÷ 150 = 233.33. The share now trades at 210, which is a paper loss of 150 × 23.33 = 3,500.
To bring the average to 220 by buying at 210, you need n shares where (35,000 + 210n) ÷ (150 + n) = 220. Rearranged, n = (35,000 − 220 × 150) ÷ (220 − 210) = 2,000 ÷ 10 = 200 shares, costing 42,000. You would then hold 350 shares that cost 77,000 in total: exactly 220 each.
With charges of 0.1% plus 20 per order on both sides, the first two purchases carry 45 and 30 in charges, so the cost is 35,075 and the average cost 233.83. Break-even is (35,075 + 20) ÷ (150 × 0.999) = 234.20, and reaching an average cost of 220 at 210 takes 214 shares rather than 200.
Formulas and scoring rules
- Average buy price
average = Σ(price × quantity) ÷ Σ quantity- Charges on a purchase
charges = value × buy % ÷ 100 + flat fee per orderReplaced by the exact amount when one is typed on the row.- Average cost
average cost = (Σ value + Σ charges) ÷ Σ quantity- Break-even sale price
S = (total cost + flat sell fee) ÷ (quantity × (1 − sell % ÷ 100))- Profit or loss at price P
P&L = P × Q × (1 − sell % ÷ 100) − flat sell fee − total cost- Shares to reach a target average T at price p
n = (C + f − T × Q) ÷ (T − p × (1 + b)), with C the current cost, Q the shares held, b the buy % as a fraction, f the flat feeOnly valid when n comes out positive: the target must lie between your current average and the effective buy price. n is rounded up to whole shares.
Averaging down: what the arithmetic does not tell you
Lowering your average price feels like progress, but it does not change what the shares are worth today. It increases the money you have in one company, and if the price keeps falling the loss grows faster than before. The calculator answers how many shares - whether to buy them is a separate question about the business, your other holdings and how much you can afford to lose.
This is a calculation, not investment advice. It does not know anything about the share, its prospects or your circumstances.
Average price for tax is a different question
Tax rules decide which purchase a sale comes from, and they do not always use the average. In the UK, shares of the same company are pooled at their average cost for capital gains (the "section 104 holding" in HMRC's helpsheet HS284), with special rules for shares bought within 30 days of a sale. In India, sales from a demat account are matched first-in, first-out for capital gains. The US lets investors choose specific lots or use first-in, first-out. Check the rules that apply to you before using this figure on a tax return.
Limitations: what the result does not prove
- Charges are only what you enter. Taxes on gains, dividends received, depreciation of a currency and the cost of money tied up are not included.
- Bonus issues, splits and rights issues change the number of shares and the price per share. Adjust the earlier purchases yourself (for a 1:1 bonus, double the quantity and halve the price) before averaging.
- The target calculation assumes you buy all the extra shares in one order at one price. Buying in several orders adds a flat fee each time.
- Profit or loss at the current price is a paper figure until you sell, and a sale at that price is not guaranteed.
Privacy: where your data goes
Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.
Standards and sources
- SEBI Investor Website - investor education from the Securities and Exchange Board of India
- Investor.gov (US SEC) - Cost basis
- HMRC helpsheet HS284 - Shares and Capital Gains Tax (section 104 pooling)
Frequently asked questions
How do I calculate the average price of a stock I bought at different prices?
Multiply each purchase price by the number of shares bought at that price, add the results, and divide by the total number of shares. 100 shares at 250 and 50 at 200 give 35,000 ÷ 150 = 233.33 per share. Adding brokerage to the 35,000 gives the average cost.
How many shares do I need to buy to average down?
Use n = (current cost − target × shares held) ÷ (target − buy price). Holding 150 shares that cost 35,000, a target of 220 at a price of 210 needs (35,000 − 33,000) ÷ 10 = 200 shares. The target must be above the price you are buying at, or it can never be reached.
Why can't I bring my average below the current price?
Every new share costs the current price, so it can only pull the average towards that price. Even buying an enormous number of shares leaves the average a little above the purchase price. A target at or below the price you buy at is refused for that reason.
What is the break-even price after brokerage?
It is the sale price at which the proceeds, after selling charges, equal everything you paid including buying charges. With a cost of 35,075 on 150 shares and selling charges of 0.1% plus 20, the break-even is (35,075 + 20) ÷ (150 × 0.999) = 234.20.
Should brokerage be included in the average buy price?
For judging profit, yes - charges are part of what the shares cost you, so the calculator shows both the plain average price and the average cost including charges. Broker apps often show the price without charges, which is why the two can differ by a few paise or cents a share.
Does averaging up make sense?
It is the same arithmetic in the other direction: buying more of a share that has risen raises your average. Some investors add to winning positions on purpose. The calculator shows how many shares a higher target needs, and refuses targets above the price you would buy at.
Is the average price the same as the cost used for tax?
Not necessarily. The UK pools shares at average cost, but India matches demat sales first-in first-out and the US allows specific lot identification. Use the average for tracking your position and check your country's tax rules for the figure on a return.
Last reviewed by the A2Z.Tools team against the sources listed above.