Stock Average Cost Calculator

Calculate your average cost basis across multiple stock purchases. Track unrealized gain or loss.

By Konstantin Iakovlev · Updated September 2026 · Source: SEC

Purchases
$
$
$

Average Cost per Share

$138.00

Total Shares

25.00

Total Invested

$3,450.00

Current Value

$3,625.00

Unrealized Gain/Loss

+$175.00 (5.07%)

Purchase History

Buy #1: 10.00 shares @ $150.00$1,500.00
Buy #2: 15.00 shares @ $130.00$1,950.00

Average cost is calculated as total investment divided by total shares (dollar cost averaging). This does not account for fees, commissions, dividends, or tax implications. Not financial advice.

Use the Stock Average Cost Calculator above to calculate your results. Enter your values and see instant results — all calculations run in your browser.

Disclaimer: This calculator is for informational purposes only and does not constitute tax, financial, or legal advice. Results are estimates based on the information you provide and current rates. Always consult a qualified tax professional or financial advisor for advice specific to your situation.

How It Works

Buying the same stock across several orders leaves you with one question that matters: what did you really pay per share on average? The weighted average price answers it and anchors any honest read on how the position is doing. A clean cost basis across all your buys is what supports sound decisions and sensible handling of capital gains tax.

The figure comes from dividing the total cost of every purchase by the total number of shares held. Each purchase contributes shares acquired multiplied by their purchase price, so each price counts in proportion to the shares it bought. The calculator has no commission field; to include a commission, add it to that purchase's price per share (commission ÷ shares).

Fold those purchase commissions into the basis rather than leaving them out, since dropping them inflates your apparent gain and can push you into overpaying tax. The other easy oversight is a stock split or reverse split, which shifts your per-share cost and has to be carried through before the average means anything.

Example: Averaging Two Purchases

  1. 1 Input (the calculator's defaults): you bought 10 shares at $150 and later 15 more at $130, and the stock now trades at $145.
  2. 2 Total cost: 10 × $150 + 15 × $130 = $1,500 + $1,950 = $3,450 for 25 shares.
  3. 3 Average cost: $3,450 / 25 = $138.00 per share.
  4. 4 At $145 the position is worth 25 × $145 = $3,625, an unrealized gain of $175.00, or 5.07% of the $3,450 invested. Had the first purchase carried a $5 commission, you would enter its price as $150.50 ($150 + $5 ÷ 10 shares), which lifts the average to $138.20.

Source: SEC · Last updated: September 2026

Frequently Asked Questions

How do I calculate my average cost basis for stocks?
Divide the total amount invested by the total number of shares. If you bought 50 shares at $100 and later 50 shares at $80, your average cost is (50x100 + 50x80) / 100 = $90 per share.
Does averaging down on a stock make sense?
Averaging down (buying more at lower prices) reduces your cost basis but increases your exposure to a potentially declining stock. It only makes sense if you believe the stock is fundamentally undervalued and your original investment thesis is intact.
How does cost basis affect my taxes?
Your cost basis determines your capital gain or loss when you sell. Higher cost basis means lower taxable gains. Methods like FIFO (first in, first out) or specific lot identification can be used to select which shares are sold for tax optimization.