We Are Calculator logoWe Are Calculator

Stock Average Calculator

Average cost per share with fees, and how many shares to buy to average down.

Keep your result

We'll email you a PDF of these numbers. Want a nudge to check them again later? Tick the reminder.

We'll use this address to send your PDF and, if you tick it, one reminder. Nothing else unless you also opt in to the newsletter. See our Privacy Policy.

We Are Calculator
We Are Calculator

Free financial calculators. Where an official rule applies, the calculator shows the source it was checked against. No sign-up, and every calculation runs entirely in your browser. Nothing you type is sent to us unless you download a PDF or ask us to email you your result.

Share this tool

How the Stock Average Calculator Works

Your average cost per share is the total you paid, fees included, divided by the shares you own. Buy 50 shares at $40, 30 at $32 and 20 at $25 with a $1 fee each, and you've paid $3,463 for 100 shares: $34.63 a share. Enter your buys below to see yours.

How the Average Cost Per Share Is Calculated

Multiply each buy's shares by its price, add any commission or fee, and add the lots together. Then divide by total shares. This is a weighted average, so a large buy moves the result more than a small one. Fees belong in the total because the IRS counts commissions and transfer fees as part of what you paid for stock (IRS Publication 550).

BuySharesPriceFeeCost
150$40.00$1.00$2,001.00
230$32.00$1.00$961.00
320$25.00$1.00$501.00
Total100$3.00$3,463.00

Average: $3,463 ÷ 100 = $34.63. Without fees it would be $34.60. Three cents looks small, but on a large or frequently traded position the gap adds up, and leaving fees out makes your break-even look lower than it is.

How Many Shares to Buy to Average Down

To pull your average down to a target, use: shares needed = shares owned × (current average − target) ÷ (target − today's price). With 100 shares at a $34.63 average, a $24 price and a $30 target, that's 100 × 4.63 ÷ 6 = 77.2, so 78 shares costing $1,872. The new average is $29.97 on 178 shares.

Two limits apply. Your average can only move toward today's price, never past it, so a $24 target at a $24 price can't be reached. And each step closer costs more: going from $30 to $27 in this example would take another 177 shares at $24. The calculator shows the cash required before you commit to it. The same formula works for averaging up when the price has risen above your average.

Break-Even Price and What a Partial Sale Is Worth

Your break-even is the price at which selling everything returns what you paid: total cost plus the selling fee, divided by shares. In the example, ($3,463 + $1) ÷ 100 = $34.64.

For a partial sale, most brokerage apps show profit against your average cost. Sell 40 shares at $38 with a $1 fee and you receive $1,519. Against the $34.63 average, that's a $133.80 gain, and the 60 shares you keep still average $34.63. Selling does not change the average of what remains; only buying does.

Average Cost vs. the Cost Basis on Your Tax Form

For individual stocks and ETFs, the IRS doesn't use your average cost by default. If you don't identify which shares you sold, the shares bought first are treated as sold first (FIFO). Average basis is allowed only for mutual fund shares and shares bought through a dividend reinvestment plan (IRS Publication 550; Treasury Regulation 1.1012-1).

Same sale: 40 shares at $38, $1 feeBasisResult
Average cost (what apps show)40 × $34.63 = $1,385.20$133.80 gain
FIFO (default for stocks)40 × $40.02 = $1,600.80$81.80 loss

You can tell your broker which lots to sell at the time of the sale (specific identification). The calculator shows the FIFO figure next to the average-cost figure so you can see the difference before you sell.

Averaging Down After Selling at a Loss

If you sell shares at a loss and buy the same stock within 30 days before or after that sale, it's a wash sale and the loss can't be deducted on that return. This includes purchases in your IRA or Roth IRA and purchases by your spouse (IRS Publication 550). The disallowed loss is generally added to the basis of the new shares rather than lost for good, but the timing changes. If you're planning to average down and also harvest a loss on the same stock, check the dates first.

What This Calculator Doesn't Cover

It doesn't track stock splits, dividends, return-of-capital distributions, wash-sale basis adjustments or shares received as gifts or inheritances. It doesn't pull live prices. The FIFO figure assumes you entered buys oldest first and that all lots are in one account. It doesn't compute capital gains tax; use the Capital Gains Tax calculator for that. Not tax advice.

Sources checked Nov 19, 2026: IRS Publication 550 (basis, FIFO, wash sales); 26 CFR 1.1012-1. Not tax advice.

Stock Average Calculator FAQ

How do you calculate the average price of a stock?

Multiply the shares in each purchase by the price paid, add any commission, and sum all purchases. Divide that total by the number of shares you own. For 50 shares at $40, 30 at $32 and 20 at $25 with $1 fees, the total is $3,463 for 100 shares, so the average cost is $34.63.

How many shares do I need to buy to lower my average cost?

Use shares owned × (current average − target average) ÷ (target − current price), then round up. With 100 shares averaging $34.63, a $24 price and a $30 target, you need 77.2, so 78 shares costing $1,872. The target must sit between today's price and your current average.

Does selling shares change my average cost?

No. Selling removes shares at the current average, so the shares you keep have the same average cost per share. Only new purchases change it. Your tax basis is a separate question: for individual stocks the IRS uses FIFO unless you choose specific shares, so the gain on your tax form can differ from the profit shown in your app.

Can I use average cost basis for stocks on my taxes?

Generally no. IRS rules allow the average basis method for mutual fund shares and for shares acquired through a dividend reinvestment plan. For other stocks, if you don't identify the shares sold, the earliest shares are treated as sold first (FIFO). You can pick specific lots by instructing your broker at the time of the sale.

Do brokerage fees count in my cost basis?

Yes. IRS Publication 550 says the basis of stock is generally the purchase price plus costs of purchase such as commissions and transfer fees. Including fees raises your average cost and your break-even price slightly, and lowers the taxable gain when you sell. Most commission-free trades have no fee to add.

Is averaging down a good strategy?

It lowers your break-even price, but it also puts more money into a position that has already fallen. Whether that makes sense depends on why the price dropped and how large the position becomes compared with the rest of your portfolio. The calculator shows the cash needed and the new position size so you can judge the trade-off.