Your average cost per share is everything you paid for a stock, commissions included, divided by your shares. It's the price the whole position needs to reach to break even.
You add up the buys, and the calculator does the division. What it can't tell you: for individual stocks, the IRS usually works from a different number.
What counts toward the total you invested?
For each purchase, multiply the shares by the price and add the commission. The IRS treats that commission as part of your cost basis, the amount a gain or loss is measured from.
- Reinvested dividends are purchases too. Add each reinvested amount, and the shares it bought.
- After a split, your total stays the same while the share count changes. Enter the new count, or work it out with the stock split calculator.
- A return of capital, also called a nondividend distribution, lowers your basis, the IRS says.
Your trade confirmations list each price and fee. For stock bought after 2010, your broker also reports the basis on Form 1099-B.
Averaging down: what three buys do to your average
Say you bought 100 shares at $60. The price slid, and you added 100 at $45, then 200 more at $30:
| Position | Total invested | Shares | Average cost |
|---|---|---|---|
| After buy 1: 100 shares at $60 | $6,000 | 100 | $60.00 |
| After buy 2: plus 100 at $45 | $10,500 | 200 | $52.50 |
| After buy 3: plus 200 at $30 | $16,500 | 400 | $41.25 |
The plain average of the three prices is $45. Your real average is $41.25, because the cheapest buy was also the biggest. Weighting by share count is the step that's easy to skip when you average in your head.
Your money at risk grew from $6,000 to $16,500 along the way. From $30, the stock must climb 37.5% just to bring the position back to even. Whether that's likely depends on why the price fell, and no average can tell you that.
The IRS rarely uses your average
For individual stocks, the IRS doesn't let you use your average cost to figure a gain or loss. The exceptions are certain mutual fund shares and certain dividend reinvestment plans. Each sale is matched to specific shares instead:
- Specific identification. Identify the exact shares with your broker, and your basis is what those shares cost, plus fees.
- First in, first out. Can't identify them? Then the shares you bought first count as sold first.
Here's what that means if you sell 100 of the 400 shares at $50:
| Shares treated as sold | Cost per share | Gain / loss |
|---|---|---|
| First in, first out: the $60 lot | $60.00 | −$1,000 |
| Specific identification: the $45 lot | $45.00 | $500 |
| Specific identification: the $30 lot | $30.00 | $2,000 |
| Your average cost (not allowed for stocks) | $41.25 | $875 |
One sale on one day can show a $1,000 loss or a $2,000 gain, depending on which shares you name. The $875 based on your average never reaches the tax return. The stock calculator works out each version if you enter that lot's price.
Mutual funds work differently
With mutual fund shares, you can elect the average basis method. The IRS describes it as adding up the cost of all your shares and dividing by the number you own. That's exactly the sum this calculator does.
Averaging down can set off a wash sale
A wash sale happens when you sell stock at a loss and buy substantially identical stock around the sale. The window runs 30 days before and 30 days after. You can't deduct that loss. Instead, it's added to the cost of the replacement shares.
Buying more on a dip walks you right into this. Say you own 100 shares bought at $60 and add 100 at $30. Two weeks later, you sell the first 100 at $30 to book a $3,000 loss. Your new shares fall inside the 30-day window:
| Basis of the 100 new shares | Total basis | Per share |
|---|---|---|
| Purchase price only | $3,000 | $30.00 |
| Plus the disallowed $3,000 loss | $6,000 | $60.00 |
The loss isn't lost for good. It moves into the new shares' basis, now $60 a share, and shrinks your gain when you eventually sell them. It just can't lower your tax this time.
A lower average isn't a better position
Your average is a break-even price and nothing more. It shifts with every buy, while the market price takes no notice of what you paid.
Averaging up shows the reverse effect. Buy 100 shares at $40 and 100 more at $50, and your average rises to $45. The gain per share shrinks, but every further rise now pays on 200 shares instead of 100. So the average tells you where break-even sits, not whether a purchase was wise.
Sources
- IRS, FAQs: Stocks (options, splits, traders) (reviewed August 26, 2026)
- IRS, FAQs: Mutual funds (costs, distributions, etc.) (reviewed September 24, 2026)
- IRS, Instructions for Schedule D (Form 1040) (2025): wash sales
- IRS, Topic no. 703, Basis of assets (reviewed September 24, 2026)
- IRS, Instructions for Form 8949 (2025): covered securities