Stock Average Cost Calculator

List each purchase on its own line, as shares and price per share. You get the average cost per share, the total cost with commission, the price at which you break even, and the average after a purchase you plan.

Free Runs in your browser Checked Tuesday, November 10, 2026

Shares, then the price per share, separated by a space, a tab or a semicolon. For example: 100 25.50

Charged on every purchase and on the sale, as a share of the value. Enter 0 if you pay none.

Optional. Enter it with the price to see the average after the purchase.

Optional. The price you expect to pay for the planned shares.

Result

Average cost per share — Total cost, commissions included, divided by the total shares.
Total shares — All the purchases added up.
Total cost — The value of the purchases plus their commissions.
Break-even price per share — The price at which selling every share returns the total cost, after the sale commission.
Average cost after the planned purchase — Shown when you enter the planned purchase.
Change in the average cost — The average after the planned purchase minus the average now.

How the figures are worked out

Each purchase and the running average

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. In Purchases, one per line, write each purchase on its own line: the number of shares, then the price per share.
  2. Type the Commission on each trade that your broker charges, as a percentage of the value.
  3. Optionally, type a Planned purchase with its shares and price to see the average after it.
  4. Read the Average cost per share and the Break-even price per share, then the table of purchases.

How the average cost is calculated

When you buy shares at different prices, the average cost per share is the total amount you paid divided by the number of shares. A purchase of many shares counts more than a purchase of few, so the average is a weighted average of the prices. This is the average cost method of the cost basis, which Wikipedia describes as widely used by mutual funds.

Commission is part of what you paid, so it is added to the total cost of each purchase. The break-even price is found the same way from the sale side: selling every share must bring in the total cost after the commission on the sale.

Cost of a purchase = shares × price × (1 + commission)

Average cost per share = total cost ÷ total shares

Break-even price = total cost ÷ (total shares × (1 − commission))
  • Buying 100 shares at 25.50 and 50 at 30 gives an average of (2,550 + 1,500) ÷ 150 = 27.00 without commission.
  • Each purchase adds its shares and its cost to the totals; the average after a planned purchase uses the same totals.

Why the break-even price is above the average

The average cost includes the commission you paid on the purchases, but the break-even price also includes the commission you pay when you sell. That is why it is a little higher than the average, even though the price per share is the same.

What this calculator does not include

  • Taxes on gains from a sale, and any tax rules on which shares are sold first.
  • Dividends and other income from the shares, which reduce the average cost when they are reinvested or taken as cash.
  • Stock splits, rights issues and fees other than the commission.

Worked example: 100 at 25.50, 50 at 30 and 200 at 22, with 0.5% commission

The values are 2,550, 1,500 and 4,400, a total of 8,450 for 350 shares. The commission at 0.5% adds 42.25, so the total cost is 8,492.25.

The average cost is 8,492.25 ÷ 350 = 24.26 per share. The break-even price is 8,492.25 ÷ (350 × (1 − 0.005)) = 24.39: at that price, after the 0.5% sale commission, the 350 shares return the total cost.

Figure
Total shares 350
Total cost, commission included 8,492.25
Average cost per share 24.26
Break-even price per share 24.39

Frequently asked questions

Why is the average cost lower than my last purchase price?

The average is weighted by the number of shares bought at each price. If you bought more shares when the price was low, the average sits below the recent price.

Does the average include the commission?

Yes. Each purchase's commission is added to its cost, so the average is the cost per share including commission. Enter 0 in the commission field if you do not pay one.

How do I see the effect of buying more shares?

Enter the planned number of shares and the price in the planned purchase fields. The calculator shows the new average and how much it changes.

Does the break-even price include tax?

No. It covers only the commission. Taxes on a sale depend on your country and your gain, and are not included.

Is my data sent to a server?

No. The calculation runs in your browser, and nothing you enter is sent to us.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.