Stock Average Price Calculator, Explained

After reading this you will be able to compute your average cost per share across several purchases, read the unrealized gain or loss on the whole position, and avoid the common arithmetic traps that make people misjudge their break-even.

What the average price tells you

When you buy the same stock more than once at different prices, your "cost" is no longer a single number. You need a weighted average: the total money spent divided by the total shares held. That single figure is your break-even price before fees and taxes. If the current price sits above it, the position shows an unrealized gain. Below it, an unrealized loss.

Here is the hook. Suppose you buy 10 shares at 150, then 5 more at 120. A quick mental average of the two prices gives 135. The true weighted average is 140, because you own twice as many of the expensive shares. That 5-point gap is the whole reason this tool exists: the simple average of prices is almost never your real cost.

When to use it, and when not

Use the weighted average whenever you have made multiple buys and want to know your break-even, size an "averaging down" decision, or estimate the profit on the full lot. It answers one question cleanly: at what price does this position stop losing money?

Do not use it as a return figure. The average price ignores time. A position you have held for three years and one you opened last week can share the same average cost and the same current price, yet their annual returns differ enormously. For time-weighted results use the CAGR Calculator or the IRR Calculator. For a plain gain percentage on money in versus money out, the ROI Calculator is the right home.

The average price is not adjusted for inflation, dividends, or fees unless you fold those in yourself. It is a nominal cost basis, nothing more. Treat it as a break-even marker, not a performance score.

The formula and why it is weighted

Let each purchase i consist of q_i shares bought at price p_i. The average cost per share is total spend over total shares.

\bar{p} = \frac{\sum_{i} q_i p_i}{\sum_{i} q_i}

Here q_i p_i is the cash spent on purchase i, the numerator sums that cash across every buy, and the denominator sums the shares. The result \bar{p} is dollars per share.

The weighting is the whole point. A plain average of the prices, \frac{1}{n}\sum p_i, treats a 100-share buy and a 1-share buy as equal votes. They are not. The share counts are the weights, so a large purchase pulls the average toward its own price in proportion to its size.

Once you have the current price c and total shares Q = \sum q_i, the unrealized profit and loss follows directly.

\text{P/L} = (c - \bar{p}) \times Q

The percentage return on cost is (c - \bar{p}) / \bar{p}, which equals the return you would get on any single share, since every share now carries the same average cost.

A worked example with the demo data

Three buys, one current price

The demo loads three purchases and a current price of 130:

The three purchases from the demo data
BuySharesPriceCash spent
1101501500
25120600
3895760
  1. Total shares: 10 + 5 + 8 = 23.
  2. Total spent: 1500 + 600 + 760 = 2860.
  3. Average cost: \bar{p} = 2860 / 23 \approx 124.3 dollars per share.
  4. Current value: 23 × 130 = 2990.
  5. Unrealized P/L: 2990 − 2860 = 130, a gain.
  6. Return on cost: 130 / 2860 ≈ 4.55%.

Notice that the simple average of the three prices, (150 + 120 + 95) / 3 = 121.7, is lower than the true 124.3. The 10-share buy at 150 carries the most weight, so it drags the real average up.

Watch a new buy move the average

Averaging down means buying more shares at a lower price to pull your break-even toward the current market. The effect depends on how many shares you add relative to what you already hold. A tiny top-up barely moves the number; a large one moves it a lot.

Starting from the demo position (23 shares at an average of 124.3, total cost 2860), suppose you add shares at 95. Adding 10 shares brings the average to (2860 + 950) / 33 ≈ 115.5. Adding 30 shares brings it to (2860 + 2850) / 53 ≈ 107.7. Adding 60 shares brings it to (2860 + 5700) / 83 ≈ 103.1. The average slides toward 95 but never reaches it.

The curve falls steeply at first, then flattens as it approaches 95. Doubling your added shares does not double the effect.

Reading and interpreting the result

Three numbers matter once the calculation is done.

Average cost
Your break-even price before fees and tax. Sell above it and you realize a gain; sell below and you realize a loss.
Unrealized P/L
The paper gain or loss on the whole position: (c - \bar{p}) \times Q. It becomes real only when you sell.
Return on cost
The P/L as a fraction of what you spent. In the demo, 4.55%. This is not annualized, so it says nothing about how good the return is for the time held.

A useful sanity check: the average cost must always fall between your lowest and highest purchase price. In the demo it sits at 124.3, between 95 and 150. If your result lands outside that range, you have a data error.

Common mistakes

The errors below account for most wrong answers people get by hand.

  • Averaging the prices, not the cost. As shown, 121.7 instead of 124.3. Always weight by shares.
  • Forgetting fees. A 5 dollar commission on a 600 dollar buy raises your real cost basis by nearly 1%. For a fee-aware view of a single trade, see the Crypto Profit Calculator, which folds exchange fees into break-even.
  • Mixing sells into the buy list. This tool averages purchases only. A sale reduces your share count and complicates cost basis under rules like FIFO or average-cost accounting. Do not paste sells as negative rows.
  • Ignoring reinvested dividends. Each reinvestment is another buy at that day's price. If you drip, your true average includes those lots. The Dividend Reinvestment (DRIP) Calculator models that growth, and the Dividend Yield Calculator shows yield on your cost.

Related tools

Once you know your cost basis, other calculators answer the questions this one cannot. For a forward projection with regular contributions, use the Investment Growth Calculator. To strip inflation out of a return, the Inflation-Adjusted Return Calculator applies the Fisher equation. To see how fund fees erode a balance over decades, try the Investment Fee Impact Calculator. When you plan the size of your next buy against a fixed risk budget, the Position Size Calculator gives the share count, and the NPV Calculator handles the present value of an uneven cash-flow series.

Frequently asked questions

Does the average price include brokerage fees?

Only if you build them in. Add each fee to that purchase's cost. For example, 5 shares at 120 with a 5 dollar fee is a cost of 605, so treat the effective price as 605 / 5 = 121 per share.

What happens to my average when I sell some shares?

Under average-cost accounting a sale does not change your per-share average; it only reduces the share count. Under FIFO the shares sold come from your oldest lots, which can change the average of what remains. This tool assumes buys only, so recompute from your remaining lots after a sale.

Can averaging down guarantee I break even sooner?

It lowers your break-even price, but it raises the dollars at risk. In the demo, adding 30 shares at 95 drops the average from 124.3 to about 107.7, yet your total invested climbs from 2860 to 5710. A lower break-even on a larger stake is not automatically better.

Why is my average higher than the midpoint of my prices?

Because you bought more shares at the higher prices. The weighted average leans toward whichever price absorbed the most shares. The midpoint ignores those quantities.

Is the current price field required?

No. Leave it blank and the tool still reports your average cost and total invested. Fill it in to see the unrealized gain or loss.

These figures are educational estimates, not financial advice. Averaging down lowers your break-even but raises your exposure, so confirm your reasoning still holds before adding, and speak with a qualified adviser before making money decisions.