Want a Custom tool for Yourself?

Need a Custom Tool? We build custom tools that can save hours per employee per day.

Stock Average Calculator

Calculate your average stock cost after multiple buys at different prices, and see total shares, total cost, and new average price.

Stock Average Calculator

   

   




Result will appear here...


Last updated: May 17, 2026

Created by: Eon Tools Dev Team

Reviewed by: Olga Chernova



What this stock average calculator does

You bought a stock. Then you bought more of it at a different price, and possibly more again after that. Somewhere in among those transactions is a single number that tells you what your position actually cost you per share, and your broker probably shows it but rarely shows the working.

This does the working. Enter each purchase as a pair, how many shares and at what price, and it returns your total shares, your total cost, and your average price per share. There is room for up to twenty five separate purchases.

The arithmetic is straightforward. The interesting part is what people do with the answer, which is usually to decide whether to buy more. There is a section on that and it tries to be honest rather than encouraging.

Everything runs in your browser. Nothing typed here is stored or sent anywhere.

How to use it

  1. Number of shares and price per share for your first purchase.
  2. The same for your second. Two purchases is the minimum, which makes sense given that with one purchase your average is just the price you paid.
  3. Add Shares to create another pair of fields for each further purchase, up to twenty five in total.

Press Calculate. Press Reset to clear everything, including any extra rows you added.

Fill both fields of a pair or neither. A row with a share count and no price, or a price and no share count, stops the calculation rather than guessing.

Enter the price you actually paid per share. If you want commission included in your average, add it in yourself: divide your total commission for that purchase by the number of shares and add it to the price. Most brokers show your average both ways, and the one including costs is the more useful figure.

Why it is not the average of the prices

This is a weighted average, and the weighting is what people get wrong.

Average price = total cost ÷ total shares

Where the total cost is every purchase's shares multiplied by its price, added up.

The temptation is to average the prices themselves. That only gives the right answer when you bought the same number of shares at each price, which is rarely how it happens.

Buy 100 shares at 50 and then 50 shares at 30. The simple mean of 50 and 30 is 40. Your actual average is:

(100 × 50 + 50 × 30) ÷ 150 = 6,500 ÷ 150 = 43.33

More than three currency units per share adrift, because two thirds of your shares were bought at the higher price and they pull the average toward it. On a large position that difference is real money and it changes where you think your break-even sits.

The rule: the price you bought most shares at dominates. Averaging prices ignores that entirely.

A worked example

You bought 100 shares at 50, then the price fell and you bought another 100 at 30.

Total shares: 100 + 100 = 200

Total cost: (100 × 50) + (100 × 30) = 5,000 + 3,000 = 8,000

Average price: 8,000 ÷ 200 = 40.00

Here the simple mean of the two prices happens to give the same answer, 40, because the share counts matched. That is the special case rather than the rule, and it is why people think averaging prices works.

Change the second purchase to 50 shares instead of 100 and the answer moves to 43.33 while the simple mean stays at 40. Same two prices, different answer, because the weights changed.

How much you would need to buy to hit a target average

The question people are usually really asking is the reverse one: what would it take to bring my average down to a particular number? That has a formula, and it is not one you will find on many calculator pages.

Shares to buy = held shares × (current average − target average) ÷ (target average − buy price)

Say you hold 100 shares at an average of 50, and the market price is now 30.

Target averageShares you must buy at 30Additional cost
45331,000
42672,000
401003,000
381504,500
353009,000

Look at the shape of that. Getting from 50 down to 45 costs 1,000. Getting from 40 down to 35 costs another 6,000. The cost accelerates sharply as the target approaches the current market price, because you are trying to drag a fixed block of expensive shares toward a number using ever larger quantities of cheap ones.

And the average can never actually reach 30 no matter how much you buy. It approaches it and never arrives, because those original 100 shares at 50 are always in the total.

That asymptote is worth sitting with before deciding how much to commit.

What averaging down actually changes

A lower average feels like progress. It is worth being precise about what it does and does not do.

Take our example again: 100 shares at 50, then 100 more at 30, giving 200 shares at an average of 40. Here is the position value at various prices, before and after that second purchase.

PriceProfit or loss on the original 100Profit or loss on all 200
302,000 loss2,000 loss
351,500 loss1,000 loss
401,000 lossbreak even
45500 loss1,000 profit
50break even2,000 profit

Read the first row. At the price you just bought at, your loss is identical either way. Buying more did not reduce your loss by a single unit, because the new shares are worth exactly what you paid for them.

What changed is everything after that. Above 30 you recover faster, and you now break even at 40 rather than needing the price back at 50. That is the genuine benefit and it is real.

What also changed, and gets mentioned far less, is that your money at risk went from 5,000 to 8,000. Below 30 you now lose money faster than before, on a larger position, in a stock that has already fallen 40 percent. You have not reduced your risk. You have increased your exposure in exchange for a lower recovery point.

Whether that is a good trade depends entirely on whether the stock is cheap or simply falling, which is a question about the business rather than about arithmetic. The calculator can tell you the average. It cannot tell you that.

The honest framing: averaging down is buying more of something. Ask yourself whether you would buy it at this price if you held none of it. If the answer is no, the fact that you already own some is not a reason.

This average is probably not your tax basis

Worth knowing before you use this figure on a tax return, because for individual shares in the United States it is generally the wrong number.

The Internal Revenue Service permits an average basis method, but only for mutual fund shares and certain regulated investment companies, and you have to elect it. For individual stocks it is not available.

Individual shares use one of two methods instead. First in, first out is the default: if you sell without specifying, the oldest shares are treated as sold first. Since those are often your cheapest, FIFO tends to produce the largest taxable gain. Specific identification lets you nominate exactly which shares you are selling, provided you identify them adequately at the time, and it is usually the more tax efficient choice because it lets you sell your most expensive lots first.

So an average of 40 across 200 shares is an excellent number for understanding your position and a poor one for filling in a tax form. If you sell 100 of those 200 shares, your gain depends on which 100 the broker treats as sold, not on the average.

Keep your individual purchase records. This calculator gives you the summary, and the underlying lots are what the tax authority cares about.

Rules differ elsewhere. Several countries do use an average cost method for equities, so check your own jurisdiction rather than assuming either way.

Questions people ask

How do I calculate my average share price?

Total cost divided by total shares. Multiply each purchase's shares by its price, add those together, then divide by the total number of shares you hold.

Can I just average the two prices?

Only if you bought the same number of shares at each. Otherwise it is wrong. 100 shares at 50 and 50 at 30 averages to 43.33, not 40.

Should I include brokerage fees?

Ideally yes, since they are part of what the shares cost you. Divide each purchase's commission by its share count and add that to the price before entering it.

How many shares do I need to buy to get my average to a certain price?

Held shares times (current average minus target) divided by (target minus buy price). See the table above for how quickly the cost rises.

Does it handle selling some of my shares?

No, it only totals purchases. In most accounting treatments a partial sale does not change your average cost per share anyway, it just reduces the count.

Is this my cost basis for tax?

For individual shares in the United States, generally no. Average basis is restricted to mutual funds and similar. Individual stocks use FIFO or specific identification. See the section above.

How many purchases can I enter?

Twenty five. If you have more than that, total up a few of the smaller ones into a single equivalent line first.

References

A note on sourcing. The weighted average calculation is definitional. The restriction of average basis to mutual funds and similar regulated investment companies, and the default use of first in first out for individual shares, are set out by the Internal Revenue Service and apply to United States taxpayers. Other jurisdictions treat cost basis differently, some using an average method for equities.

  1. Internal Revenue Service, Mutual Funds (Costs, Distributions, etc.). https://www.irs.gov/faqs/capital-gains-losses-and-sale-of-home/mutual-funds-costs-distributions-etc
  2. Internal Revenue Service, Stocks (Options, Splits, Traders). https://www.irs.gov/faqs/capital-gains-losses-and-sale-of-home/stocks-options-splits-traders
  3. Internal Revenue Service, Topic No. 409, Capital Gains and Losses. https://www.irs.gov/taxtopics/tc409
  4. Internal Revenue Service, Publication 550, Investment Income and Expenses (Including Capital Gains and Losses).


Olga Chernova

Olga Chernova is an equity research analyst and final year Economics and Finance student at the American University in Bulgaria, with hands on experience in valuation and financial modeling. She has passed CFA Level I and contributed to a 2nd place team in the 2025-2026 CFA Institute Research Challenge in Bulgaria. At Eon Tools, she reviews finance tools.