Skip to main content
CalcMax

Stock Average Calculator

Range: 0 – 100,000

Result

46.6667

Average price paid per share

Break-even price per share
46.67
Total shares held
300.0000
Total cash cost
14,000.00

When you buy the same stock several times at different prices, the price you actually paid per share is not the plain average of those prices — it is a weighted average, weighted by how many shares each purchase was for. Buy 100 shares at 50 and 50 at 60 and the answer is 53.3333, not 55, because three quarters of your money went in at the lower price. That weighted average is your cost basis per share, and this page computes it from two parallel lists: the shares bought, and the price paid, entry by entry. On top of it the page adds commission. Commission does not change what you paid for the shares, but it does change what you have to get back before you are even, so the page prints a second, higher figure — the break-even price — with the whole commission spread across the whole position. Type the two lists, see both numbers, and the gap between them is exactly what the commission cost you per share.

One position, six commission levels, and the price you need to break even

CommissionAverage priceBreak-even priceTotal cost
046.666746.6714000
5046.666746.8314050
10046.66674714100
20046.666747.3314200
40046.66674814400
80046.666749.3314800

Every row is the same position — 300 shares bought for 14,000 across three purchases — so the only thing moving is what the broker charged, and reading down the table is reading what a fee does to a number you thought you already knew. The second column does not move at all, and that is the point of the first two columns being side by side: commission is not part of what a share cost, so the average price is 46.6667 on every row. The third column is the one that responds, and it responds slowly — 46.67 at no commission, 46.83 at 50, 47.00 at 100, and 49.33 only once the commission reaches 800. That is the arithmetic of spreading a fixed fee over a fixed number of shares, and it is why commission is worth agonising over on a small position and nearly irrelevant on this one. Read the last two columns together to see the trade: at 800 of commission the position costs 14,800 rather than 14,000, which is 5.7% more cash for the same 300 shares. The first row is the case with no commission at all, included so the table has a baseline — there the break-even price is just the average price rounded to two decimals, and the whole gap in every other row is the column on the left.

Formula

Average price = Σ (Shares bought × Price paid) ÷ Σ Shares bought

Shares bought
How many shares each purchase was for, one figure per purchase; these are the weights, which is why a larger purchase pulls the average harder
Price paid
The price per share on each purchase, one figure per purchase, in the same order as the share counts
Total cost
The sum of shares times price across all purchases, plus the commission — the cash that actually left your account to build the position
Total shares
The sum of the share counts; printed because the average is meaningless without the size of the position it describes
Average price
Total cost of the shares alone, divided by total shares, to four decimals — the weighted average price and the cost basis per share
Break-even price
Everything including the commission, divided by the same share count: the price the stock has to reach for the position to be flat, and the only figure on the page that answers whether you are up or down

Use it to find your true cost basis after buying the same stock more than once — for working out whether a sale is a gain or a loss, for deciding where to set a stop, or simply to know what number you are waiting for. Use the break-even figure when commission was material relative to the position, which happens on small purchases and on brokers that charge per trade: it is the price that actually matters, and it is always above the weighted average. What this page is not is a portfolio tracker. It assumes every purchase listed is still held and that nothing has been sold, so after a sale the remaining cost basis has to be recomputed under whatever method applies to you. It also treats the position as one pool; if you are in a jurisdiction where each purchase keeps its own basis, the weighted average is a summary rather than the figure that goes on the return.

Worked examples

  1. Three purchases: 100 at 50, 50 at 60, 150 at 40

    1. Cost of each purchase: 100 × 50 = 5,000, 50 × 60 = 3,000, 150 × 40 = 6,000
    2. Total cost: 5,000 + 3,000 + 6,000 = 14,000; total shares: 100 + 50 + 150 = 300
    3. Average price: 14,000 ÷ 300 = 46.6666…, so 46.6667 to four decimals
    4. With no commission the break-even price is the same figure rounded to two decimals: 46.67

    The default, and the case that shows why weighting matters. The three prices 50, 60 and 40 average to 50 if you treat each purchase equally — the wrong answer by 3.33, because the 150 shares at 40 are half the position while the 50 shares at 60 are a sixth of it. Notice how close the break-even price sits to the average here: with commission at zero the only difference between the two columns is rounding, which is exactly what the reference table's first row is for.

  2. Two purchases with 25 of commission: 100 at 10 and 300 at 20

    1. Cost of the shares: 100 × 10 = 1,000, 300 × 20 = 6,000, so 7,000 for 400 shares
    2. Average price: 7,000 ÷ 400 = 17.50 exactly — a round number the commission does not touch
    3. Add the commission to the total: 7,000 + 25 = 7,025
    4. Break-even price: 7,025 ÷ 400 = 17.5625, so 17.56 — six cents above the average price

    The case that separates the two figures on the panel. The weighted average price is 17.50 and stays 17.50 however much commission was paid, because commission is not part of what a share cost. The break-even price is 17.56, and the six cents between them is the 25 of commission divided across 400 shares. Sell at 17.50 and the position looks flat on the average price and is actually 25 down; that is the whole reason both numbers are printed.

  3. A small position where commission dominates: 100 at 30, 100 at 45, commission 10

    1. Cost of the shares: 200 × 30 = 6,000, 100 × 45 = 4,500, so 10,500 for 300 shares
    2. Average price: 10,500 ÷ 300 = 35.00 exactly
    3. Add commission: 10,500 + 10 = 10,510
    4. Break-even price: 10,510 ÷ 300 = 35.0333…, so 35.03

    A round 35.00 average and a break-even three cents above it, on a position bought in two lots at prices fifteen apart. The weighted average lands on a round number here because the weights happen to cancel the spread; that is arithmetic, not a sign the method is approximate. Read the last two columns together as the summary of the position: 300 shares, 10,510 of cash out, and a price of 35.03 to get back to even.

Limitations

Four things. The average is weighted by share count, not by purchase — the plain mean of the prices you paid is a different and usually wrong number, and it is wrong in the direction that matters, because it ignores that the biggest purchase carries the most money. The break-even price is a price on the shares alone: it does not include what it will cost to sell, so if your broker charges commission on the way out as well, the true break-even is above the figure here. Nothing on this page handles a sale. If you have already sold part of the position, the remaining cost basis depends on which shares the sale is deemed to have come from, and the weighted average over everything you ever bought is not that figure. That matters more than it sounds: the U.S. default rule for identical stock is first in, first out, and averaging every share in the account is a separate election available only in specific cases — for shares of a regulated investment company, or for dividend reinvestment plan shares acquired after 2010 and held with a custodian — not a general choice. And none of this is tax advice: whether averaging applies to you, and which lots a sale consumes, is a question for the rule in your own jurisdiction.

Frequently asked questions

Is the average price just the mean of the prices I paid?
No, and that is the most common mistake this page exists to prevent. It is a weighted average, weighted by the number of shares in each purchase. Buying 100 at 50, 50 at 60 and 150 at 40 gives a plain mean of 50 and a weighted average of 46.6667 — the 3.33 difference is the 150 shares at 40 counting for half the position while the 50 shares at 60 count for a sixth. A plain mean would treat a ten-share purchase and a ten-thousand-share purchase as equally important.
Why are there two prices on the result panel?
Because commission does not change what a share cost, but it does change what you have to sell for to be even. The average price divides the cost of the shares by the share count; the break-even price adds the commission to the numerator first. On 400 shares bought for 7,000 with 25 of commission, the average price is 17.50 and the break-even is 17.56. The gap is the commission per share, and it is the figure to compare against the market price.
How do I enter the two lists?
One figure per purchase, in order, separated by spaces or commas — shares 100 50 150 and prices 50 60 40. The two lists have to line up: the first price belongs to the first share count, and so on. If they have different lengths the entry cannot be paired up and is rejected rather than silently truncated, because a misaligned list would produce a weighted average of prices that were never actually paid together.
Can I use this as my cost basis for tax?
It is the same arithmetic as the average basis method, but whether you may use that method is a separate question with its own answer. Under U.S. rules the default for identical stock is first in, first out, and averaging across an account is an election available only in specific cases — for shares of a regulated investment company, or for dividend reinvestment plan shares acquired after 2010 and held with a custodian. Outside those cases, averaging everything you ever bought is not the figure that goes on the return. Check the rule that applies to you before treating this number as a tax figure.
What happens if I have already sold some shares?
Then this page no longer describes your position. It assumes everything listed is still held, and a weighted average over all the purchases you ever made includes shares you no longer own. After a sale the remaining basis depends on which shares the sale consumed, which is a question of the rule and the election that apply to you rather than of arithmetic. Recompute from the lots that are left, not by averaging the ones that are gone.
Does the share count have to be whole numbers?
No — fractional shares work, and so do entries that produce a fractional average, which is why the average price is printed to four decimals rather than two. The price is rounded to four decimals because it is a per-share cost where a hundredth of a cent can matter over a large position, while the break-even price is printed to two because it is a price you compare against a market quote. The total cost stays at two decimals, since it is money.

References

Related calculators