CalCentralSearch

Stock Average Calculator

Find your average price per share across up to 20 purchases, with the total shares and cost, and the gain or loss at a current price if you enter one.

By Rich · Formula reviewed October 19, 2026

Switch calculator

Purchases
Row 1 can be the position you already hold, at its average price.
Leave empty or at 0 to leave out the value and the gain or loss.

Results

What this calculator answers

When you buy the same stock more than once at different prices, the average price per share is the single price that would give the same total cost for the same total number of shares. This calculator takes up to 20 purchases and returns that average, the total number of shares and the total amount spent. It starts with two purchases. Select “Add purchase” for another row, and the delete icon to remove one. The first row can be a position you already hold, entered at its average price, so you can see what one more purchase does to it.

The current price is optional. Leave it empty or at 0 and the page shows only the average, the shares and the cost. Enter a price above 0 and four more rows appear: the value at the current price, the gain or loss before selling in dollars and as a percentage, and the move to break-even.

The Chart tab draws two lines: the price paid at each purchase and the average price after it. The “Purchases” table lists each purchase with its shares, price and cost.

The formula

Each purchase k has a number of shares s and a price p. The total cost C adds up shares times price over the purchases, the total shares S adds up the shares, and the average price P divides one by the other. This is a weighted average of the prices, with the number of shares as the weights.

P = Σ sₖ·pₖ / Σ sₖ,  C = Σ sₖ·pₖ,  S = Σ sₖ,  V = S·q,  G = V − C,  r = G / C,  M = (P − q) / q

Because the weights are shares, a large purchase moves the average more than a small one, and the average always sits between the lowest and the highest price you paid.

The last four apply only with a current price q. The value V is the total shares times q. The gain or loss G is the value minus the total cost. The rate r is that gain or loss as a share of the cost. The move M is how far q must change, in percent, to reach the average price.

IRS Publication 550 describes a gain or loss on a sale as the amount realized minus the basis. Here the value at the current price stands in for the amount realized, before any selling costs.

A worked example

Suppose you bought 100 shares at 50 and later 100 shares at 40. The second purchase was at a lower price, and since both purchases are the same size, the average lands exactly halfway between them: $45.00 per share.

Averaging down and averaging up

Buying more shares below your average price lowers the average. Buying more above it raises the average. This is only arithmetic. It says nothing about whether a purchase is a good idea.

Averaging down: you buy 100 shares at 50, then 50 shares at 20, and the current price is 35. The average is $40.00 over 150 shares, for a total cost of $6,000.00. At 35 the shares are worth $5,250.00, so the gain or loss before selling is -$750.00, or -12.5%. The move to break-even is 14.29%: the price must rise that much to get back to the average.

Averaging up: you buy 50 shares at 20, then 50 shares at 30, and the current price is 28. The average is $25.00. At 28 the shares are worth $2,800.00, a gain before selling of $300.00, or 12%. The move to break-even is -10.71%: the price could fall that much before it reaches the average.

What the result does not include

Fees are not part of the calculation. A commission paid on a purchase raises what you really paid per share. To include it, divide the commission by the number of shares in that purchase and add the result to its price. With no fee field, the average is the break-even before selling fees and taxes. The “Move to break-even” row shows how far the current price must move to reach it: a positive figure means it must rise, a negative one that it can fall that far. Selling costs and taxes on any gain would push the real break-even higher.

The average is also not necessarily your tax cost basis. The IRS describes dividing the total cost by the total number of shares (the average-basis method) for mutual fund shares and for shares in a dividend reinvestment plan, so for other stock the figure here is an average price, not a tax figure.

The calculator uses every purchase row on the form. A row with zero shares or a zero price is an error, not a skipped row, so remove it with the delete icon if you have fewer purchases to enter.

FAQ

Are commissions and fees included in the average?

No. It uses only the shares and prices you enter; "What the result does not include" shows how to add a commission per share.

Is the average price my break-even price?

Only before selling fees and taxes, as "What the result does not include" explains.

Is this my cost basis for taxes?

Not necessarily. For US taxes the IRS describes the average-basis method for mutual fund shares and for shares kept in a dividend reinvestment plan, so this average is not automatically the cost basis you report for other stock. Check the rules that apply to you.

How do I add or remove a purchase?

Select "Add purchase" to add a row, up to 20. Select the delete icon on a row to remove it. A removed row is gone, with its values, and the rows below it move up. The form always keeps at least two purchases.

Is averaging down the same as dollar-cost averaging?

No. Averaging down means buying more after the price has fallen, in any amount. Dollar-cost averaging means investing the same amount at regular intervals, whatever the price. The DCA calculator on this site works out that one.

What is a weighted average, and how does it differ from a simple average?

A simple average adds the prices and divides by how many there are. A weighted average gives each price a weight, here the number of shares bought at it. For 100 shares at 50 and 50 shares at 20, the simple average of the two prices is 35, but the weighted average is $40.00, because more shares were bought at 50.

Can I use it for ETFs or crypto?

Yes, for anything you buy in units at a price per unit. Fractional amounts are accepted, so a part of a coin or a share works. Fees and tax rules differ by asset, and the calculator includes neither.

How it's calculated

P = Σ sₖ·pₖ / Σ sₖ,  C = Σ sₖ·pₖ,  S = Σ sₖ,  V = S·q,  G = V − C,  r = G / C,  M = (P − q) / q
s
shares bought in a purchase
p
price per share in a purchase
C
total cost
S
total shares
P
average price per share
q
current price per share
V
value at the current price
G
gain or loss before selling fees and taxes
r
gain or loss as a share of the total cost
M
move of the price needed to reach the average price

Tested against 14 reference cases with known results.

Sources:

Report an error

Email us at contact@calcentral.org

Please mention this page: /stock-average-calculator/

Open in email app

This calculator is for information only and is not financial advice.