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.
Current position and planned buy Example values
Tip: the new buy price is usually today’s market price, so the first result also shows your profit or loss right now.
(a) New average after buying N shares
(b) Shares needed to reach a target average
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.
Worked example (the default values)
| Lot | Shares | Price | Shares × price | Fee |
|---|---|---|---|---|
| 1 | 50 | $40.00 | $2,000.00 | $1.00 |
| 2 | 30 | $32.50 | $975.00 | $1.00 |
| 3 | 20 | $28.00 | $560.00 | $1.00 |
| Total | 100 | $3,535.00 | $3.00 |
- Average without fees: $3,535.00 ÷ 100 = $35.35.
- Average with fees: ($3,535.00 + $3.00) ÷ 100 = $35.38.
- With a $1.00 selling commission, break-even is ($3,538.00 + $1.00) ÷ 100 = $35.39.
- 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:
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.
- A − T = $40.00 − $35.00 = $5.00.
- T − P = $35.00 − $25.00 = $10.00.
- N = 100 × 5 ÷ 10 = 50 shares, costing 50 × $25.00 = $1,250.00.
- 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:
- Averaging down (P < A): any target with P < T < A works. A target at or below $25.00 in the example cannot be reached, however many shares you buy.
- Averaging up (P > A): the target must satisfy A < T < P.
- If T equals A, you need zero shares. If P equals A, buying never changes the average.
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.
| Method | Basis of shares sold | Where it applies |
|---|---|---|
| Average cost | Same average for every share | Tracking your position; US tax: mutual fund and qualifying DRIP shares (election) |
| Specific identification | Cost of the exact lots you choose to sell | US tax, when you can adequately identify the shares |
| FIFO | Cost of the earliest shares bought | US 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
- A lower average is not a reason the price will recover. The stock does not know your cost. The question is whether you would buy it today with fresh money.
- Concentration grows. FINRA defines concentration risk as “the risk of amplified losses that may occur from having a large portion of your holdings in a particular investment, asset class or market segment relative to your overall portfolio” (FINRA, Concentrate on Concentration Risk). Each buy into a falling stock adds to that risk.
- Losses need bigger gains to recover. A 50% fall needs a 100% rise to get back to even. Averaging down lowers the rise you need, but only by adding capital at risk.
- Size the buy against your risk limit. Decide the maximum you are willing to lose on the whole position, not just the new lot. The position size calculator and risk/reward calculator help with that.
- Wash sale rule (US). If you sell shares at a loss and buy substantially identical stock within 30 days before or after the sale, IRS Publication 550 says the loss cannot be deducted then; the disallowed loss is added to the cost of the new shares, which postpones the deduction. Buying more and then selling older, losing lots can trigger this.
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
- Averaging the prices instead of weighting by shares.
- Leaving out commissions, which understates cost and break-even.
- Recalculating the average after a sale by removing the sale proceeds instead of the cost of the shares sold.
- Ignoring stock splits. After a 2-for-1 split, double the shares and halve the price of every earlier lot before you enter them.
- Setting a target average at or beyond the current price; it cannot be reached.
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
- Profit/loss calculator
Gain or loss on a single trade. - Position size calculator
How many shares fit your risk limit. - DCA calculator
Scheduled buys over time. - Capital gains tax calculator
Estimate tax on a sale. - Trading journal
Log each buy and sell.
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.