The short answer: selling does not change your average
Your average stock price is computed from your purchases only: total cash spent buying shares divided by the number of shares bought. A sale does not add a purchase, so it cannot enter that calculation. Selling removes shares from your position, but the shares that remain were bought at the same prices as before — so their average is unchanged.
Think of it this way: the average describes what you paid for the shares you hold. Selling some of them does not rewrite what you paid for the rest. What the sale does change is your remaining cost basis in dollars (fewer shares × the same average) and your realised gain or loss on the shares you sold.
You can see this in your brokerage app: sell part of a position and the average cost per share shown for the remaining shares does not move. It only moves when you buy more shares — a new purchase blends into the average at its own price, which is exactly what our Stock Average Calculator models.
Worked example: Buy 100 at $50, 50 at $40, sell 50
Walk through the numbers once and the rule sticks:
Average Price Before and After Selling 50 Shares
- Lot 1: 100 shares at $50.00 = $5,000.00.
- Lot 2: 50 shares at $40.00 = $2,000.00.
- Total cost $7,000.00 for 150 shares; average stock price = $7,000.00 ÷ 150 = $46.67 per share.
- Sell 50 shares: the 100 shares you still own still average $46.67 per share — the sale does not move it.
- Remaining cost basis: 100 shares × $46.67 = $4,666.67.
- The 50 shares you sold carried $2,333.33 of cost basis with them (50 × $46.67). $4,666.67 + $2,333.33 = $7,000.00 — the full original cost, split between the shares kept and the shares sold.
The common mistake: averaging the sale price in
The error most investors make is treating the sale price as if it were another purchase. Suppose you sell those 50 shares at $55.00. Averaging the $2,750.00 of sale proceeds in as though you had bought more shares gives ($7,000.00 + $2,750.00) ÷ 200 = $48.75 — a meaningless number. The sale price is money coming in, not money spent buying shares, so it has no place in an average cost.
Done correctly, the sale is a gain calculation, not an averaging calculation: you received $2,750.00 for shares that cost you $2,333.33 (50 × $46.67), for a gain of $416.67. Your remaining 100 shares still average $46.67, and $55.00 is now simply the price to beat if you buy more. To work out your average before any sale, use our Stock Average Calculator or read how to calculate average stock cost.
Sale fees and taxes: what actually changes
Broker fees on the sale reduce your net proceeds — and therefore your gain — but they do not change the average price of the shares you still own. A $5.00 sale fee on the example above would cut the gain from $416.67 to $411.67; the remaining average stays $46.67.
Tax is a separate question from average cost. In the US, the default tax method for individual stocks is FIFO (first-in, first-out), not average cost — the shares treated as sold are your earliest lot, which can give a different realised gain from the $416.67 average-basis figure. Average-cost pooling is generally permitted only for mutual funds and dividend reinvestment plans. Your brokerage tax statement (Form 1099-B) shows the lots actually used, and the rules are explained in our average stock cost guide.