Stock Average Calculator

Your average cost per share is the total amount paid for all shares divided by the number of shares. Enter each buy below to get it with and without fees, plus your break-even price, or plan how many shares it takes to average down to a target.

Purchase lots Example values Replace them with your own buys. Fractional shares are fine. Commission is optional.

Total shares–
Total cost incl. fees–
Average cost (no fees)–
Average cost incl. fees–
Break-even price incl. fees–
Market value–
Unrealized profit / loss–

Money is shown to 2 decimals; prices under $1 are shown to 4 decimals. Everything is calculated in your browser. Nothing is saved or sent.

How the stock average calculator works

Each purchase is weighted by its number of shares. A buy of 100 shares moves the average twice as much as a buy of 50 shares at the same price. That is why a simple average of the prices is wrong when lot sizes differ.

Average cost (no fees) = Σ(shares × price) ÷ Σ shares Average cost incl. fees = (Σ(shares × price) + Σ fees) ÷ Σ shares Break-even price = (total cost incl. fees + selling fee) ÷ Σ shares Unrealized P/L = market price × Σ shares − total cost incl. fees − selling fee

Worked example (the default values)

LotSharesPriceShares × priceFee
150$40.00$2,000.00$1.00
230$32.50$975.00$1.00
320$28.00$560.00$1.00
Total100$3,535.00$3.00
  1. Average without fees: $3,535.00 ÷ 100 = $35.35.
  2. Average with fees: ($3,535.00 + $3.00) ÷ 100 = $35.38.
  3. With a $1.00 selling commission, break-even is ($3,538.00 + $1.00) ÷ 100 = $35.39.
  4. At a market price of $30.00, the position is worth $3,000.00. Unrealized P/L = $3,000.00 − $3,538.00 − $1.00 = −$539.00 (−15.23% of cost).

A plain average of the three prices would be $33.50. It is too low because it gives the small $28.00 lot the same weight as the 50-share lot.

Shares needed to average down: the formula

Start with S shares at an average cost A. You can buy more at price P and want a new average T. The new average after buying N shares is (S×A + N×P) ÷ (S + N). Set that equal to T and solve for N:

N = S × (A − T) ÷ (T − P) With a commission f on the new buy: N = (S × (A − T) + f) ÷ (T − P)

Worked example

You own 100 shares with an average cost of $40.00. The stock now trades at $25.00. You want an average of $35.00.

  1. A − T = $40.00 − $35.00 = $5.00.
  2. T − P = $35.00 − $25.00 = $10.00.
  3. N = 100 × 5 ÷ 10 = 50 shares, costing 50 × $25.00 = $1,250.00.
  4. Check: ($4,000.00 + $1,250.00) ÷ 150 = $35.00.

When a target is impossible

A new average always lands between the old average and the new buy price. It gets closer to the new price as N grows but never reaches it. So the target must lie strictly between P and A:

The number of shares grows fast as the target approaches the new price. In the example, a $30.00 target needs 100 × 10 ÷ 5 = 200 shares; a $26.00 target needs 100 × 14 ÷ 1 = 1,400 shares. The chart in the planner shows this curve for your own numbers.

Fees and the break-even price

Commissions raise your true cost. IRS Publication 550 (2025) says: “The basis of stocks or bonds you own is generally the purchase price plus the costs of purchase, such as commissions and recording or transfer fees.” FINRA’s Cost Basis Basics gives the same rule and adds that reinvested dividends also count toward cost basis.

Break-even is the sale price at which you get back everything you paid, including the commission to sell. Many brokers charge $0 commission on US stocks, but some accounts, foreign markets and small-cap venues still charge fees. Enter 0 if you pay none.

Partial sales: average cost vs FIFO

Under the average cost method, every share you hold has the same cost: total cost ÷ total shares. If you sell 40 of 100 shares with a $35.38 average, the 40 sold leave at $35.38 each. The remaining 60 shares still have a $35.38 average. Your total cost drops to 60 × $35.38 = $2,122.80. Selling never moves the average under this method; only new buys do.

Tax reporting can work differently. For most individual stocks, IRS Publication 550 says: “If you buy and sell securities at various times in varying quantities and you cannot adequately identify the shares you sell, the basis of the securities you sell is the basis of the securities you acquired first. Except for certain mutual fund shares, discussed later, you cannot use the average price per share to figure gain or loss on the sale of the shares.” The average basis method is allowed for identical shares left with a custodian that are mutual fund shares or shares held in connection with a dividend reinvestment plan (DRIP), under conditions set out in the publication.

MethodBasis of shares soldWhere it applies
Average costSame average for every shareTracking your position; US tax: mutual fund and qualifying DRIP shares (election)
Specific identificationCost of the exact lots you choose to sellUS tax, when you can adequately identify the shares
FIFOCost of the earliest shares boughtUS tax default when shares cannot be identified

Your broker reports cost basis on Form 1099-B. FINRA advises checking that figure against your own records and contacting the firm if they differ. Rules in other countries differ; check your local tax authority. To estimate tax on a sale, see the capital gains tax calculator.

Risks of averaging down

Averaging down a losing position is different from dollar-cost averaging, which is a fixed schedule of buys set in advance, regardless of price.

Common mistakes

FAQ

How do you calculate the average price of a stock?

Multiply the shares in each purchase by the price paid, add those amounts together, and divide by the total number of shares. For example, 100 shares at $40 and 100 shares at $30 cost $7,000 for 200 shares, so the average is $35.00 per share. Add commissions to the total cost if you want the average including fees.

How many shares do I need to buy to average down?

Use N = S × (A − T) ÷ (T − P), where S is the shares you own, A is your current average cost, P is the new buy price and T is the target average. With 100 shares at $40, a new price of $25 and a target of $35, N = 100 × 5 ÷ 10 = 50 shares. The target must lie strictly between the new price and the current average, or no number of shares can reach it.

Does selling shares change my average cost per share?

Under the average cost method, a partial sale removes shares at the average cost, so the average cost per share of the shares you still hold stays the same. Your total cost falls in proportion. Tax rules can differ: for most individual stocks the IRS uses the cost of the specific shares you can identify, or the shares acquired first, rather than an average.

Should commissions be included in the average cost?

Yes, for cost basis. IRS Publication 550 says the basis of stocks or bonds is generally the purchase price plus the costs of purchase, such as commissions and recording or transfer fees. This calculator shows the average both with and without fees so you can compare.

Is averaging down a good strategy?

It lowers your average cost, but it also puts more money into one position that is already losing. That raises concentration risk, which FINRA describes as the risk of amplified losses from holding a large portion of your portfolio in one investment. A lower average does not make the stock more likely to recover.

What is the difference between average cost and FIFO?

Average cost gives every share the same basis: total cost divided by total shares. FIFO (first in, first out) treats the shares you sell as the earliest ones you bought, each with its own price. IRS Publication 550 allows the average basis method for mutual fund shares and certain dividend reinvestment plan shares; for other stock, if you cannot identify the shares sold, the shares acquired first are treated as sold.

Related tools

Educational tool only, not financial, investment or tax advice. Results depend on the numbers you enter and do not predict future prices. Tax rules quoted are from IRS Publication 550 (2025) and apply to US taxpayers; check current rules or a tax professional before filing. Sources: IRS Pub. 550, FINRA Cost Basis Basics, FINRA Concentration Risk. Retrieved 23 Oct 2026.