Stock Average Calculator

This stock average calculator turns up to three purchases of the same stock into one average cost per share, then shows your gain or loss at today’s price. Enter shares and price for each buy, add any fees, and your break-even price appears instantly.

Average cost per share

 

Total shares
 
Total cost (including fees)
 
Gain or loss at current price
 
Return on cost
 

Below I explain the math, a worked example with real numbers, and the tax detail most calculators skip: your average is a planning number, and the IRS may not use it for your actual tax bill.

How to use the stock average calculator

Fill in one row per purchase, starting with your oldest buy. Leave lot 3 at zero if you only bought twice.

  • Shares and price: the number of shares you bought and the price per share for that purchase. Fractional shares work, so enter 2.5 if that is what you own.
  • Fees: the total commissions and fees across all purchases. Leave it at zero for commission-free trades.
  • Current price: today’s quote. This only drives the gain or loss lines, not the average itself.

Have more than three buys? Add up the total dollars and total shares from the extra purchases and enter them as one lot. Because the average is weighted, combining lots gives the same answer. Reinvested dividends count as buys too, each at the price on the reinvestment date.

To see profit after you sell, use the stock calculator profit page instead. This tool is built for the question “where do I stand if I keep holding?”

How average cost per share is calculated

The calculator uses a weighted average, which means bigger purchases count for more than smaller ones. In plain words:

  • Total cost = (shares in lot 1 × price) + (shares in lot 2 × price) + (shares in lot 3 × price) + fees
  • Total shares = shares in lot 1 + lot 2 + lot 3
  • Average cost per share = total cost ÷ total shares
  • Gain or loss = (current price × total shares) minus total cost

The most common slip is averaging the prices themselves. Prices of $50 and $40 have a simple midpoint of $45, but if you bought twice as many shares at $50, the true average sits closer to $50. The share counts do the weighting.

Your average cost is also your break-even price. Sell above it and you are ahead on that position before taxes, sell below it and you are behind.

Worked example: 100 shares at $50, then 50 at $40

These are the calculator’s default numbers. Lot 1 costs 100 × $50 = $5,000. Lot 2 costs 50 × $40 = $2,000. Total cost is $7,000 for 150 shares, so the average is $7,000 ÷ 150 = $46.67 per share.

Now suppose the stock trades at $44. Your 150 shares are worth $6,600, so you are down $400, or about 5.7% on your cost. To get back to even, the stock needs to rise about 6.1%, from $44 to $46.67. If you want to compare that with other positions on a percentage basis, the ROI calculator does the same job for any investment.

The average is not the midpoint

Two buys at $50 and $40 do not average to $45 unless the share counts match. Here the $50 lot is twice as large, so the average lands at $46.67.

How many shares do I need to average down?

Averaging down means buying more after the price falls, so your average cost drops. To hit a target average, use this formula: shares to buy = shares owned × (current average − target average) ÷ (target average − today’s price).

With 150 shares at $46.67 and the stock at $40, a $44.00 target needs 150 × 2.67 ÷ 4 = 100 shares. That costs $4,000, bringing your total to $11,000 over 250 shares. Enter 100 shares at $40 as lot 3 to confirm it.

Buy 100 more shares at New total cost New average cost
$30 $10,000 $40.00
$40 $11,000 $44.00
$44 $11,400 $45.60
$50 $12,000 $48.00

The table shows the catch. At $40 your break-even falls from $46.67 to $44.00, yet you now have $11,000 at work instead of $7,000. A drop to $30 would cost you $2,500 more on the new shares alone. Averaging down lowers the price you need to recover to, but it raises the amount you stand to lose.

What moves your average the most

Lot size beats price gap. Adding 10 shares at a very cheap $20 only moves the average from $46.67 to $45.00, while adding 100 shares at a more modest $40 moves it to $44.00. A small lot at a bargain price barely registers against a large existing position.

Two cards compare adding 10 shares at $20, giving a $45.00 average, with 100 shares at $40, giving $44.00
A big lot at $40 beats a tiny lot at $20: a $44.00 average versus $45.00.

The order of purchases does not matter for the average, only the totals. Fees matter more on small lots: a $5 fee on a 10-share buy adds $0.50 per share to that lot. If you buy in regular amounts, you can estimate where steady contributions lead with the future value of investment calculator.

Try this: Enter your biggest holding with every buy, including reinvested dividends. Then add a pretend lot 3 at today’s price worth 10%, 25% and 50% of your current shares, and note how far each one moves your average.

Does the IRS use your average cost?

Often it does not, and this is the detail that surprises people. IRS Publication 550 lets you use an average basis for mutual fund shares and certain dividend reinvestment plan shares. For individual stocks, the default is first in, first out, meaning the oldest shares are treated as sold first, unless you identify specific lots with your broker before the trade settles.

Spectrum track of three cost basis methods from specific lots to FIFO to average cost, with tradeoff arrows
Your app's average cost is a planning number; for stocks the IRS defaults to first in, first out.

Using the example above, selling 50 shares at $44 under first in, first out uses the $50 lot, a loss of $300. Under an average basis the loss would be about $133. I have seen people compare the “average cost” in their brokerage app to a Form 1099-B and assume somebody made an error, when the two simply used different methods.

So treat the calculator as your decision tool for break-even and position sizing. For tax reporting, rely on the lot-level basis your broker reports on Form 1099-B, and check which cost basis method is set on your account.

2026 tax rules that touch your cost basis

Gains on shares held more than one year are long-term and taxed at 0%, 15% or 20%, depending on taxable income. For 2026 the 0% rate reaches roughly $49,450 for single filers and $98,900 for married couples filing jointly, per the IRS inflation adjustments. Confirm the exact thresholds in the IRS 2026 revenue procedure before filing. Shares held a year or less are taxed as ordinary income, and higher earners may also owe the 3.8% net investment income tax above $200,000 (single) or $250,000 (joint) of modified adjusted gross income.

Losses have limits too. Net capital losses offset gains first, then up to $3,000 of ordinary income per year, with the rest carried forward. The wash sale rule can block a loss if you buy the same or a substantially identical security within 30 days before or after the sale. The disallowed loss is added to the basis of the replacement shares, which raises your average cost.

The rule reaches across accounts. A buy inside an IRA can trigger a wash sale on a taxable loss, and in that case the loss generally cannot be added to the IRA’s basis, so it can be lost for good. If you are weighing where to hold a stock, the Roth IRA calculator shows how tax-free growth compares.

Common mistakes when averaging a stock

These are the errors I would check first:

  • Averaging the share prices instead of weighting by shares.
  • Leaving out fees, which understates your break-even.
  • Forgetting reinvested dividends, which quietly add small lots. A dividend reinvestment calculator shows how many shares those payouts create.
  • Ignoring stock splits. In a 2-for-1 split your shares double and your price halves, so enter post-split numbers for every lot. Total cost stays the same.
  • Averaging down without a limit, until one stock is a far larger share of your savings than you planned.

One more habit worth building: record the date and price of every buy in a simple sheet. If you hold dividend payers, the dividend calculator can show how income grows as your share count does. Either way, your own records are the fastest fix when a broker transfer drops the basis information.

Stock Average Calculator: common questions

How do I calculate the average price of a stock I bought several times?

Multiply shares by price for each purchase, add the results (and any fees), then divide by the total number of shares. Buying 100 shares at $50 and 50 at $40 gives $7,000 over 150 shares, or $46.67 a share.

Is my average cost the same as my cost basis for taxes?

Not always. For mutual funds and certain dividend reinvestment shares the IRS allows average cost, but for individual stocks the default is first in, first out unless you identify specific lots. Check your Form 1099-B or broker settings to see which method applies.

Should I include commissions in my average cost?

Yes. Fees you paid to buy are part of your cost basis, so they raise your average cost per share slightly and raise your break-even price. Most commission-free brokers charge nothing, but regulatory or foreign exchange fees can still apply.

Does averaging down lower my risk?

It lowers your break-even price, but it also puts more money into a stock that has fallen. Your total loss if the price keeps dropping gets bigger because you own more shares.

How many shares do I need to buy to reach a target average?

Use shares owned times (current average minus target average), divided by (target average minus today's price). Owning 150 shares at $46.67 with the stock at $40, you need 100 more shares to reach a $44.00 average.