Skip to content

Average Cost Calculator

Find your average buy price over several purchases of a stock or crypto, and your gain.

Result

Enter your values and select Calculate to see the result.

Runs in your browser — nothing you enter is sent to a server.

How the Average Cost Calculator works

List the price of each buy, then either how many shares or coins you bought each time, or how much money you spent each time (in the same order). The calculator adds up the total invested and the total quantity and divides one by the other: that is your average cost, or cost basis, per unit.

Enter today's price to see what the position is worth and your gain or loss.

Formula

average = total spent ÷ total quantity = Σ(quantity × price) ÷ Σ quantity

When you spend the same amount each time (dollar-cost averaging), quantity = amount ÷ price, and the average cost is the harmonic mean of the prices — never above their simple average, because you buy more units when the price is low.

Examples

Two buys

10 shares at $10 and 5 shares at $20: $200 for 15 shares, an average of $13.33. At $18 today they are worth $270, a $70 gain (35%).

Same amount each time

$100 at $10 and $100 at $20 buys 10 + 5 = 15 units for $200: again $13.33, below the $15 average of the two prices.

Frequently asked questions

Should fees be included?

Yes, for a true cost basis: add each buy's fee to the amount spent, or use the "amount spent" mode with fees included.

What happens when I sell some?

With the average-cost method used in many countries, selling doesn't change the average of what's left. Other rules, such as first in, first out, work differently for tax.

Is my data stored?

No. Everything is calculated in your browser.

Crypto Profit Calculator

Work out profit or loss on a crypto trade, including exchange fees and the break-even price.

Finance Tools

ROI Calculator

Calculate return on investment as a percentage, plus the annualized return over the years you held it.

Finance Tools