Stock Average Price Calculator

Enter your buy prices and share counts to find your average cost per share.

How it is calculated

Each purchase is a price per share and a number of shares. The tool adds up the cost of every buy and divides by the total shares: average = (p1×s1 + p2×s2 + p3×s3) / (s1 + s2 + s3). Prices are in currency per share and shares may be fractional (shown to two decimals). The first two buys are required; the third is optional and counts as zero if left blank. If the third buy has a price but no share count, it is ignored, because it adds no cost or shares. Commissions, fees and taxes are not included, so add them to the price yourself if you want a cost basis that includes them. The total shares must be above zero.

Worked example

You buy 100 shares at $50, then 150 shares at $40, then 250 shares at $30. Costs: 100 × 50 = 5,000; 150 × 40 = 6,000; 250 × 30 = 7,500. Total cost: $18,500.00. Total shares: 100 + 150 + 250 = 500. Average price: 18,500 / 500 = $37.00 per share. The simple mean of the three prices would be $40, so ignoring the weights overstates your cost.

Try this example →

Common mistakes

  • Averaging the prices without weighting by shares. (50 + 40 + 30) / 3 = 40 is wrong here because the cheapest buy was also the biggest.
  • Leaving out commissions, which raise the real cost per share, especially on small or frequent purchases.
  • Entering the amount of money spent in the shares field. Shares must be the number of shares, not the dollar amount, or the average will be far too low.
  • Including a sale in the buys. This tool blends purchases only, and selling part of a position changes the cost basis under rules the tool does not apply.
  • Typing a fourth purchase's data into the third row and overwriting the earlier one. Only three buys fit, so combine earlier buys into one average first.

About this calculator

When you buy shares of the same stock at different prices over time, your true cost basis is not any single purchase price but the weighted average across all buys: Average price = Σ(price_i × shares_i) / Σ(shares_i) — each purchase’s price is weighted by how many shares it added, so a larger buy pulls the average toward its price more than a small one does.

This blended cost is what investors use to calculate their actual break-even price, gains or losses, and cost basis for tax reporting, and it’s the number that matters after averaging down (buying more shares when the price drops) or dollar-cost averaging into a position over time — not the price of your first or most recent trade.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    A quick sanity check: the blended average must always land between your lowest and highest buy price, and closer to the one where you bought more shares. If it does not, a price or share count was probably swapped. Keep in mind that buying more at a lower price lowers the break-even level but does not change what the earlier shares have already gained or lost. How many separate buys do you usually need to enter?

Popular calculators

All Calculators