Stock Average Cost Calculator

Combine several stock or crypto purchases into one average cost per share, and work out how many shares to buy at a new price to reach a target average.

Example: “75 @ 38 1.50” means 75 shares at $38 with a $1.50 commission. Fractional shares are fine.
Optional — shows your unrealized gain or loss.

Average down (or up) to a target

Total shares
225
Total invested
$9,976.50includes $1.50 in fees
Average price before fees
$44.33
Lowest / highest buy
$38.00 / $50.00
Market value
$9,225.00at $41.00 a share
Unrealized loss
−$751.50−7.53%
Shares to buy at $36.00
87.751≈ $3,159.00 to reach a $42.00 average
Average cost per share$44.34225 shares, 3 purchases
  • Average cost is for tracking. For US taxes, stocks normally use specific lots or first-in, first-out (FIFO) unless you choose otherwise; mutual funds may use average cost. Not investment advice.

Show the work

  1. Total cost = 100 × $50.00 + 50 × $42.50 + 75 × $38.00 + $1.50 = $9,976.50
  2. Average cost = $9,976.50 ÷ 225 shares = $44.34
  3. Shares needed = 225 × ($44.34 − $42.00) ÷ ($42.00 − $36.00) = 87.75

Purchase price vs. running average cost

  • Purchase price
  • Running average
$0$20$40$60Purchase pricePurchase price: $38.00Running averageRunning average: $44.34Buy 1Buy 2Buy 3
Your purchases
#SharesPriceFeeCostTotal sharesRunning average
1100$50.00—$5,000.00100$50.00
250$42.50—$2,125.00150$47.50
375$38.00$1.50$2,851.50225$44.34
Total225$1.50$9,976.50$44.34

If you have bought the same stock, fund or coin more than once, you probably own shares at several different prices. Your average cost per share is the single number that tells you where you break even. This calculator combines any number of purchases, includes commissions, shows your gain or loss at today’s price, and works out how many more shares you would need to buy to pull the average to a target.

How to use the average cost calculator

  1. List each purchase on its own line as shares @ price, for example 100 @ 50. Add a third number for a commission: 75 @ 38 1.50. Fractional shares are fine.
  2. Optionally enter the current share price to see the market value and unrealized gain or loss.
  3. To plan a new purchase, enter a target average cost and the price of the next purchase. The calculator returns the number of shares and dollars needed.

Average cost formula

The average cost is a weighted average — larger purchases count for more:

Average cost = Σ(Sharesi × Pricei + Feesi) ÷ Σ Sharesi

To reach a target average T by buying more shares at price P, when you currently hold S shares at average A:

n = S × (A − T) ÷ (T − P)

The formula comes from setting (S·A + n·P) ÷ (S + n) equal to T and solving for n.

Worked example

You bought a stock three times: 100 shares at $50, 50 shares at $42.50, and 75 shares at $38 with a $1.50 commission.

Total cost = 5,000 + 2,125 + 2,851.50 = $9,976.50

Average cost = 9,976.50 ÷ 225 = $44.34 per share

At today's price of $41, the position is worth $9,225 — an unrealized loss of $751.50 (−7.53%)

To bring the average down to $42 by buying at $36:

n = 225 × (44.34 − 42) ÷ (42 − 36) ≈ 87.75 shares, costing about $3,159

After that purchase you would own about 312.75 shares at an average of $42, so a rebound to $42 would put you back at break-even instead of $44.34.

Averaging down vs. dollar-cost averaging

These sound alike but are different decisions:

Approach What triggers a purchase Main risk
Dollar-cost averaging The calendar — a fixed amount every week or month Little; it simply spreads purchases over time
Averaging down A falling price in a stock you already own Adding to a loser and concentrating the portfolio
Averaging up A rising price in a winner Raising your break-even and buying at higher valuations

Dollar-cost averaging into a diversified fund automatically buys more shares when prices are low. Averaging down into a single company is a bet that the drop is temporary.

Average cost and taxes

Your broker tracks cost basis lot by lot. When you sell part of a position, the gain depends on which lots are sold — by default first-in, first-out for stocks, or specific lots you choose. The IRS allows the average-cost method mainly for mutual fund shares and some dividend reinvestment plans. Use the stock profit calculator for a single sale and the capital gains tax calculator to estimate the tax.

This calculator is a tracking and planning aid, not investment advice. Your broker's cost-basis records are authoritative for taxes.

Frequently asked questions

How do I calculate my average cost per share?

Add up what you paid for every purchase, including commissions, and divide by the total number of shares you own. Buying 100 shares at $50, 50 at $42.50 and 75 at $38 (plus a $1.50 fee) costs $9,976.50 for 225 shares, an average of $44.34.

How many shares do I need to buy to lower my average?

Use n = S × (A − T) ÷ (T − P), where S is the shares you own, A your current average, T the target average and P the new purchase price. The target must lie between your current average and the new price, or no purchase can reach it.

Is averaging down a good strategy?

It lowers your break-even price, but it also puts more money into a position that has already fallen. It makes sense only if your reasons for owning the stock still hold. Many investors cap any single holding at a fixed share of the portfolio to avoid over-concentration.

Is average cost the same as my tax cost basis?

Not always. For individual stocks, US brokers default to first-in, first-out unless you pick specific lots, so the basis of the shares you sell may differ from the average. The average-cost method is generally allowed for mutual fund shares and certain dividend reinvestment plans.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.