Finance · Investing

Stock Average Cost Calculator

Enter every purchase of a stock or fund to find your weighted average cost per share, including dollar-cost-averaging style purchases made over time. Add a current price to see an unrealized gain or loss.

Methodology reviewed Jul 14, 20262 primary sourcesHow it worksInputs stay on this device
Your inputs

Enter your purchases

Leave blank to skip the unrealized gain or loss section.

Your inputs are calculated locally and are not stored.
Weighted average cost per share$106.67

Across 15 shares and 2 purchases.

Total shares
15
Total invested
$1,600.00
Current value
$1,650.00
Unrealized gain/loss
+$50.00 (+3.13%)
Formula & methodology

How average cost per share is calculated

Average cost per share is a share-weighted average, not a simple average of the prices you paid. Each purchase contributes in proportion to how many shares it added, so larger purchases pull the average toward their price more than smaller ones do.

Average cost = Σ(shares × price) / Σshares
Σ(shares × price)
Total amount invested across all purchases
Σshares
Total shares purchased

This differs from a simple average of purchase prices whenever purchase sizes differ. For example, buying more shares at a lower price pulls the weighted average down further than averaging the two prices alone would suggest — which is the basis of dollar-cost averaging.

Worked example

10 shares at $100, then 5 shares at $120

Two purchases: 10 shares at $100 per share, then 5 shares at $120 per share. Total invested is $1,600 across 15 shares, for a weighted average cost of $106.67 per share. With a current price of $110 per share, the position is worth $1,650 — an unrealized gain of $50, or +3.125%.

Purchase rows and resulting average
PurchaseSharesPrice per shareAmount invested
110$100.00$1,000.00
25$120.00$600.00
Total15$106.67 (average)$1,600.00
Assumptions

What this calculator assumes

  • No transaction fees or commissions are included unless you add them into the price per share you enter.
  • No tax-lot selection, wash-sale rules, or capital-gains treatment is applied.
  • Fractional shares are supported for every purchase row.
  • The current price per share is whatever you enter — this calculator does not fetch live market data.
  • Money values are rounded to the nearest cent for display.
Common questions

Stock average cost FAQ

How is average cost different from a simple average?

A simple average treats every purchase price equally regardless of size. Weighted average cost accounts for how many shares each purchase added, so a larger purchase has more influence on the result than a smaller one at the same price.

Does this account for dividends or splits?

No. Reinvested dividends should be entered as their own purchase rows if you want them included. Stock splits are not automatically adjusted — enter post-split share counts and prices for purchases made before a split if you want a consistent average.

Can I use this for dollar-cost averaging?

Yes. Add one row per recurring purchase — for example, a monthly buy — and this calculator computes the resulting weighted average cost across all of them, up to 50 rows.

Primary sources

Sources and review notes

  1. U.S. Securities and Exchange Commission, Investor.gov — Dollar-Cost Averaging
  2. GetSmarterAboutMoney.ca, Ontario Securities Commission — investing education

Methodology last checked Jul 14, 2026. Formula implementation is covered by deterministic unit tests. No financial professional review is claimed yet.