Skip to content
MasterMath

Average Cost Basis Calculator

Buying 10 at 25, 20 at 18 and 15 at 22 gives an average of 20.89, not the 21.67 you get by averaging the three prices. Size weights the answer.

Currency and number format for

Average purchase price

—

Average purchase price—
Total units—
Total invested—
Purchases made—
Between the lowest and the highest—

How this was worked out

    The formula

    average = total invested ÷ total units

    Where it comes from

    The average cost of a position is the total money in divided by the total units held. It is a weighted average, so a big purchase moves it far more than a small one, which is why averaging the prices themselves gives the wrong answer.

    How to work it out by hand

    1. Multiply each purchase's quantity by its price to get the amount spent
    2. Add up all the amounts spent
    3. Add up all the units bought
    4. Divide the total spent by the total units

    What is worth knowing

    This figure is your break-even before costs, and it is the anchor most people use to decide when to sell — usually to their cost. What you paid has no bearing on what the asset will do next, and refusing to sell below your average is the disposition effect, one of the best documented mistakes in investing. Two practical notes: commissions belong in the total spent if you want a true break-even, and this weighted average is the cost basis method used in many countries for tax, though some require FIFO instead, which can give a very different taxable gain.

    Frequently asked questions

    Why not just average the prices?

    Because your purchases were different sizes. Averaging the prices treats a 10-unit buy and a 200-unit buy as equally important, which they are not.

    Should commissions be included?

    For a true break-even, yes: add them to the total spent. This calculator uses only what you enter.

    Is this the figure used for tax?

    Often, but not always. Some jurisdictions require FIFO or specific-lot identification, which can produce a very different taxable gain. Check your local rules.

    Should I sell once it passes my average?

    That is an anchoring habit, not a strategy. What you paid does not affect what the asset does next.