Skip to content

Stock Average Calculator

Your purchases
SharesPrice per shareFee Remove

Optional: shows your gain or loss.

Optional: how many shares at the current price would bring your average here.

Average cost per share —
Total shares
—
Total cost incl. fees
—
Unrealised gain or loss
—
Gain or loss
—
Shares to buy to reach target
—
Price paid per purchase against your average
The chart appears with your result

Your average cost per share is the total you paid for all purchases, including fees, divided by the total number of shares. Ten shares at $50 plus twenty at $40 with a $5 fee cost $1,305 for 30 shares, an average of $43.50. Buying more below that average pulls it down.

About this tool

If you bought the same stock or fund more than once, your break-even price is no longer any single price you paid. This calculator takes each purchase as its own row, with shares, price and any commission, and gives the average cost per share as you type. Add today's share price to see your unrealised gain or loss, and a target average to see how many more shares at today's price would get you there. A running-average table shows how each purchase moved the number.

How to use it

  1. Enter each purchase

    Fill one row per buy with the number of shares, the price per share and any fee. Use Add purchase for more rows.

  2. Add the current price

    Optionally type today's share price to see your unrealised gain or loss in dollars and percent.

  3. Set a target average

    Optionally enter the average you want; the result shows how many shares at today's price would reach it.

  4. Check the table

    The running-average table shows how each purchase moved your average cost.

Examples

Averaging down after a drop

Your purchases
10 × 50; 20 × 40 × 5
Current share price
38
Target average price
40

Result Average cost per share: 43.50
Total shares: 30
Total cost incl. fees: 1,305.00
Unrealised gain or loss: -165.00
Gain or loss: -12.64%
Shares to buy to reach target: 53

  1. Total cost = Σ(shares × price) + fees = 1,305.00
  2. Average = 1,305.00 ÷ 30 shares = 43.50
  3. Gain = (38.00 − 43.50) × 30 = -165.00
  4. Shares to reach 40.00 = (1,305.00 − 40.00 × 30) ÷ (40.00 − 38.00), rounded up = 53

A second, cheaper purchase pulls the average to $43.50. Buying 53 more shares at $38 would bring it just under the $40 target.

One purchase

Your purchases
100 × 12.34

Result Average cost per share: 12.34
Total shares: 100
Total cost incl. fees: 1,234.00

  1. Total cost = Σ(shares × price) + fees = 1,234.00
  2. Average = 1,234.00 ÷ 100 shares = 12.34

With a single buy and no fee, the average is simply the price paid.

Adding to a winner

Your purchases
50 × 20; 25 × 26 × 2.5
Current share price
30

Result Average cost per share: 22.03
Total shares: 75
Total cost incl. fees: 1,652.50
Unrealised gain or loss: 597.50
Gain or loss: 36.16%

  1. Total cost = Σ(shares × price) + fees = 1,652.50
  2. Average = 1,652.50 ÷ 75 shares = 22.03
  3. Gain = (30.00 − 22.03) × 75 = 597.50

Buying more as the price rises lifts the average to about $22.03, still well below the current $30.

How it is calculated

average = (Σ shares × price + Σ fees) ÷ Σ shares

shares
number of shares bought in each purchase
price
price paid per share in that purchase
fees
commission or transaction fee for that purchase, added to the cost

Each purchase adds its shares to the total and its cost, shares times price plus any fee, to the total spent. The average cost is total spent divided by total shares. To reach a target average with extra shares bought at today's price, the calculator solves (cost + n × price) ÷ (shares + n) = target for n and rounds up to whole shares.

Sources

  • Cost basis — Investor.gov (U.S. Securities and Exchange Commission)

When not to use it

  • For a tax return, use the cost basis your broker reports, because rules such as specific lot identification or wash sales can change it.
  • After a stock split or a reinvested dividend, adjust the shares and prices first, or the average will be wrong.

Common mistakes

  • Leaving out commissions, which makes the average look lower than the real break-even price.
  • Mixing currencies across purchases of the same stock bought on different exchanges.

Frequently asked questions

Do fees count towards my average cost?

Yes. Commissions and transaction fees are part of what you paid to acquire the shares, so they are added to the cost before dividing by the number of shares.

Does selling some shares change my average cost?

Under the average cost method, selling shares does not change the average of the shares you keep. Other methods, such as first-in first-out, assign the sale to specific purchases instead.

What does averaging down mean?

Averaging down is buying more of a holding after its price falls, which lowers the average cost per share. It also increases how much money is tied to that one position.

Why can't some target averages be reached?

New shares bought at today's price can only move your average towards today's price. A target outside the range between today's price and your current average is out of reach.

Can I use this for crypto or funds?

Yes. The arithmetic is the same for any asset bought in units at different prices, including fund units and fractional coins.

Cite this tool

Using this tool in an assignment, article or report? Copy a citation, or a link for your website.

APA

Tools Directory Editorial Team. (2026, October 26). Stock Average Calculator. Tools Directory. Retrieved October 26, 2026, from https://tools.milunir.com/finance/stocks-and-dividends/stock-average-calculator/

MLA

Tools Directory Editorial Team. “Stock Average Calculator.” Tools Directory, 26 Oct. 2026, https://tools.milunir.com/finance/stocks-and-dividends/stock-average-calculator/. Accessed 26 Oct. 2026.

Chicago

Tools Directory Editorial Team. “Stock Average Calculator.” Tools Directory. Last modified October 26, 2026. Accessed October 26, 2026. https://tools.milunir.com/finance/stocks-and-dividends/stock-average-calculator/.

Link<a href="https://tools.milunir.com/finance/stocks-and-dividends/stock-average-calculator/">Stock Average Calculator – Tools Directory</a>