Stock Average Calculator

This stock average calculator works out the blended average cost per share across up to six purchases, with brokerage fees folded in. Enter a current price as well and it also returns the market value, the unrealized gain or loss in dollars and percent, and the break-even price.

Stock average calculatorLive — updates as you type
PurchaseNumber of sharesPrice per share
Buy 1
Buy 2
Buy 3
Buy 4
Buy 5
Buy 6
Add this to see the position value and the profit or loss.

How to use the stock average calculator

  1. For each purchase, enter the number of shares and the price you paid per share. There is room for six, and blank rows are ignored.
  2. Add total brokerage fees if you want them included in the cost. Leave it empty to see the average of the trade prices alone.
  3. Enter a current share price if you want the position valued. This one is optional.
  4. Read the average cost per share at the top, with the total shares and total invested underneath.

Everything recalculates as you type. Below the summary you get a table of each purchase with its cost and its share of the position, a bar chart of each buy price alongside the blended average, and a numbered list of the arithmetic. Fractional share counts are accepted.

The output is arithmetic on the numbers you enter, nothing more. It reports what your position cost; what you do with that figure is your decision.

It is a weighted average, not a plain one

average cost per share = total spent ÷ total shares
Total spent is every (shares × price) added up, plus fees. Total shares is every share count added up.

The key word is total. You do not average the prices; you divide all the money by all the shares. Each price is weighted by the number of shares bought at it, so a large purchase pulls the average toward its price far harder than a small one does.

Averaging the prices on their own answers a different question and gives a different number.

Example: the two methods disagree

Two purchases: 100 shares at $20, then 400 shares at $10.

Plain average of the prices: ($20 + $10) ÷ 2 = $15.00 Weighted average, the cost basis: 100 × $20 = $2,000 400 × $10 = $4,000 $6,000 ÷ 500 shares = $12.00

$12.00 is the cost per share. The $15.00 figure ignores that four times as many shares were bought at the lower price, so it describes nothing you actually own.

The two only agree when every purchase is the same size. Any difference in share counts pulls them apart, and the bigger the difference, the wider the gap. This is the same mechanic as any other weighted mean, worked through in general terms on the weighted average calculator; the average calculator covers the unweighted kind.

A worked example with three purchases

Example: a position built over three buys

100 shares at $50, then 150 at $40, then 250 at $30.

100 × $50 = $5,000 150 × $40 = $6,000 250 × $30 = $7,500 Total shares = 100 + 150 + 250 = 500 Total spent = $5,000 + $6,000 + $7,500 = $18,500 Average cost = $18,500 ÷ 500 = $37.00

The average is $37.00, which is not the midpoint of $50, $40 and $30 — that would be $40.00. The 250-share purchase is half the position on its own, so its $30 price carries the most weight.

Because the average is a running total, it changes with every purchase. Here is the same position recalculated after each buy.

PurchaseSharesPriceCostShares heldSpent to dateAverage to date
Buy 1100$50.00$5,000100$5,000$50.00
Buy 2150$40.00$6,000250$11,000$44.00
Buy 3250$30.00$7,500500$18,500$37.00

The results table gives the last column of this in one shot, plus each purchase’s share of the position: 20%, 30% and 50% here. Those percentages are the weights. Multiply each price by its weight and you get the average back: (0.2 × $50) + (0.3 × $40) + (0.5 × $30) = $10 + $12 + $15 = $37.00.

Fees and the break-even price

Brokerage fees are part of what the shares cost you, so including them raises the cost basis. The fees field takes one total figure covering every purchase, and it is added to the money spent before the division.

Without fees: $18,500 ÷ 500 = $37.00 per share With $30 of fees: $18,530 ÷ 500 = $37.06 per share

Six cents a share on this position. On a small position bought in several pieces the effect is larger, because the fee is spread over fewer shares: $30 across 50 shares is 60 cents each.

break-even price = average cost per share
Sell at exactly this price and the money coming back matches the money that went in.

Break-even and average cost are the same number, which is most of the reason the average cost is worth knowing. At $37.06 a share, 500 shares are worth $18,530 — exactly what was paid. Above it the position is worth more than it cost; below it, less.

Example: valuing the position at $34

Market value = 500 × $34 = $17,000 Unrealized P/L = $17,000 − $18,530 = −$1,530 Return = −$1,530 ÷ $18,530 = −8.26%

The percentage is measured against total cost, not against the share price. That is why entering fees changes the return figure as well as the average.

Unrealized means on paperNothing here is bought or sold. It is the difference between what a position cost and what it would be worth at the price you typed in. The figure also does not subtract any fee you would pay on a sale.

What “averaging down” and “averaging up” mean

Both phrases describe what happens to one number, and nothing else.

Averaging down is buying more shares at a price below your current average, which pulls the average cost per share down. Averaging up is buying at a price above it, which pushes the average up. Neither term says anything about outcomes; they name the direction the arithmetic moves.

Hold 100 shares at $30 → average $30.00 Buy 100 more at $50 → 200 shares, $8,000 → average $40.00 (averaged up) Hold 100 shares at $50 → average $50.00 Buy 150 more at $40 → 250 shares, $11,000 → average $44.00 (averaged down)

How far the average moves depends on the size of the new purchase relative to what you already hold. In the second line, 150 shares against 100 already held moves the average $6. Buying just 10 shares at $40 instead would move it from $50.00 to $49.09, because 10 shares are only about 9% of the resulting position.

A lower average is not the same as a gainThe average cost measures what you paid. It moves when you buy more shares, regardless of what the share price does afterward. Whether a position is up or down depends on the current price against that average, which is a separate calculation.

What the number does not include

This is an arithmetic tool, not investment advice, and it does not account for dividends, stock splits, currency conversion or tax.

Each of those changes a real cost basis in a way this calculation does not see:

  • Dividends are cash received while holding, separate from what the shares cost. Some people track a cost basis reduced by dividends received; that is a different figure from the one here.
  • Splits change the share count and the per-share price together. After a 2-for-1 split you hold twice the shares at half the price, so the historical purchase rows need restating before an average across them means anything.
  • Currency conversion matters when a purchase was made in another currency. Convert each purchase at the rate that applied on its own trade date before entering it.
  • Tax rules vary by country and account type, and some jurisdictions require a specific cost-basis method rather than a simple average.

For percentage arithmetic on its own — the gap between a cost and a price, expressed as a percentage — the markup calculator does that in isolation.

Common mistakes

  • Averaging the prices instead of weighting them. Adding $50, $40 and $30 and dividing by 3 gives $40.00. The actual cost per share in that example is $37.00.
  • Entering the total cost of a buy in the price box. The field wants the price of one share. Put $5,000 there instead of $50 and the average comes out a hundred times too high.
  • Mixing pre-split and post-split rows. Restate the older purchases to the current share basis first, or the share count and the prices are measuring different things.
  • Entering fees per trade in a field that wants the total. The fees box takes one combined figure for the whole position.
  • Reading the return against the share price. The percentage is the gain or loss divided by the total invested, fees included, not by the current price.
  • Forgetting a purchase. A missing row changes both totals, so the average is wrong in a way nothing in the output can flag.
  • Treating the average as a target. It is a record of what you paid. It carries no information about what the price will do next.

Frequently asked questions

What is the average cost of 100 shares at $50 and 150 shares at $40?

$44.00 per share. The purchases cost 100 × $50 = $5,000 and 150 × $40 = $6,000, so $11,000 in total across 250 shares, and $11,000 ÷ 250 = $44.00. It is below the $45 midpoint of the two prices because more shares were bought at $40.

What is the average price of 100 shares at $20 and 400 shares at $10?

$12.00 per share. Total spent is $2,000 + $4,000 = $6,000, and total shares are 500, so $6,000 ÷ 500 = $12.00. Averaging the two prices gives $15.00, which is wrong here because the $10 purchase is four fifths of the position.

How do you calculate the average price of a stock?

Multiply each purchase’s share count by its price, add those costs together, add any brokerage fees, then divide by the total number of shares. It is a weighted average, so every purchase counts in proportion to its size rather than counting once.

Does the average cost include fees?

Only if you enter them. With the fees box empty the average reflects trade prices alone. Enter a total and it is added to the money spent before dividing: $18,500 of stock plus $30 of fees across 500 shares gives $37.06 a share rather than $37.00.

What is the break-even price?

It is the average cost per share. Sell every share at that price and the proceeds equal what you put in, fees included if you entered them. Above it the position is worth more than it cost, below it less. Any fee charged on the sale itself is not included in the figure shown.

What does averaging down mean?

Buying more shares at a price below your current average cost, which brings the average down. Buying above it is called averaging up and raises the average. Both are descriptions of what happens to that one number when a new purchase is added; they say nothing about how the position will perform.

How much does one extra purchase move the average?

In proportion to its size. Holding 100 shares at $50 and buying 150 more at $40 moves the average to $44.00, a $6 shift. Buying only 10 shares at $40 moves it to $49.09, because those 10 shares are a small fraction of the 110 you would then hold.

How is the unrealized profit or loss worked out?

Multiply the current price by your total shares to get the market value, then subtract the total invested. The percentage is that difference divided by the total invested. At $34 a share, 500 shares are worth $17,000 against $18,530 spent, which is −$1,530 or −8.26%.

Does this handle dividends, splits or tax?

No. It averages the purchases you enter and nothing else. Dividends received, stock splits, currency conversion and tax all affect a real cost basis and none of them are included here. After a split, restate your older purchase rows to the current share basis before averaging them.

Guides that use this calculator

Longer explanations of the method behind it, with worked examples.

Put this calculator on your own site (free)

Copy this into any page. The calculator stays up to date on its own, works on mobile, and carries a small credit link back here.

Preview it
Cite this page “Stock Average Calculator”. Four Function Calculator, 7 September 2026.https://fourfunctioncalculator.com/stock-average-calculator/
Shows the workingRuns entirely in your browser — nothing you type is sent anywhere.Last reviewed 7 September 2026