Stock Average / Cost Basis Calculator

Find your average cost per share across multiple purchases of the same stock.

Result

Average cost per share
$46.67
Total shares
150
Total invested
$7,000.00
Export:
Amount invested per purchase
  • Purchase 1$5,000.0071.4%
  • Purchase 2$2,000.0028.6%

How average cost is calculated

Your average cost per share — often called the cost basis — is the total money you put into a position divided by the total number of shares you hold. It is a weighted average, not a simple average of the prices, because a purchase of many shares pulls the average closer to its price than a small purchase does.

Each row multiplies a purchase price by the shares bought to get the amount invested in that lot. The calculator adds those amounts together, adds up the shares, and divides one by the other. Rows with zero shares are skipped, so you can leave unused rows blank.

What the numbers mean

The average cost is effectively your break-even price: if the stock trades above it you have an unrealized gain, and below it an unrealized loss. Total shares and total invested describe the size of your position overall.

The chart shows how much money went into each purchase, which makes it easy to see which lot carries the most weight in your average.

Tips for tracking cost basis

A few habits keep your cost basis accurate over time:

  • Include commissions or fees in the price you enter, since they are part of what the shares actually cost you.
  • Record each buy as it happens rather than reconstructing it later from memory.
  • Remember that selling some shares does not change your average cost under the average-cost method — it only reduces the share count.
  • Reinvested dividends count as new purchases and should be added as additional lots.

Caveats

This tool uses the average-cost method and supports up to three lots. Your broker or tax authority may track basis differently — for example, specific-identification or FIFO lots — which can change your taxable gain when you sell. It also ignores stock splits, return-of-capital adjustments, and wash-sale rules. Use the result for quick reference, not tax filing, and confirm the official basis with your broker or a tax professional.

Formula

average cost = Σ(priceᵢ · qtyᵢ) / Σ qtyᵢ