Add each purchase to get your average cost per share, and work out how many shares at today's price would move that average to a target
List each purchase — the number of shares, the price and any commission — and the calculator adds them up to your total shares, total cost and average cost per share. Then enter a current price and a target average to see how many more shares would get you there and what they would cost. The math works the same for averaging down (buying below your average) and averaging up.
Average cost = total spent (shares × price + fees, for every purchase) ÷ total shares. IRS Publication 550 (2025) uses this example: 160 shares at $25, 240 shares at $20 and a $300 dividend reinvested at $30 (10 shares). That is 410 shares costing $9,100, an average of $22.20 a share.
Shares needed = current shares × (current average − target) ÷ (target − buy price). With 410 shares averaging $22.20, buying at $18 brings the average to $21 after about 164 shares ($2,952). The target has to sit between the buy price and your current average; the closer it is to the buy price, the more shares it takes. A lower average doesn't change what the shares are worth today — it only moves the price at which the whole position breaks even.
| Buy price | Target average | Shares to buy | Cost |
|---|---|---|---|
| $16 | $21.50 | 52 | $832 |
| $16 | $21 | 99 | $1,584 |
| $18 | $21.50 | 82 | $1,476 |
| $18 | $21 | 164 | $2,952 |
| $20 | $21.50 | 191 | $3,820 |
| $20 | $21 | 491 | $9,820 |
For tax, the IRS doesn't use one average for every holding. IRS Publication 550 (2025) allows the average basis method for mutual fund shares and for shares acquired after 2011 through a dividend reinvestment plan held with a custodian; otherwise you identify the specific shares sold or use first-in, first-out (FIFO). Your broker reports basis on Form 1099-B. The average here is a tracking number for your break-even, not a substitute for the broker's basis records.
Averaging down adds money to a position that has fallen; whether that makes sense depends on why it fell and how much of your savings is in one holding. Stocks aren't FDIC insured and can keep falling. The stock profit calculator shows the gain or loss at any sale price.
Add up what you paid for every purchase (shares × price, plus fees) and divide by the total number of shares. 160 shares at $25, 240 at $20 and 10 at $30 cost $9,100 for 410 shares: $22.20 each.
Shares = current shares × (current average − target average) ÷ (target average − new price). For 410 shares at $22.20, buying at $18 to reach a $21 average takes about 164 shares.
It lowers the break-even price for the whole position, but the loss on the shares you already own is the same. Adding shares also adds money that can fall further.
Yes. Commissions are part of what you paid, so they are added to the cost before dividing by the number of shares.
Not always. IRS Publication 550 allows average basis for mutual fund shares and certain DRIP shares; for other stocks your basis follows the specific shares sold or FIFO. Your broker's Form 1099-B shows the reported basis.
Tax rules, limits and pay data change. Check the current figures with the primary source before acting on them.