Calculators·2026 tax year

Which shares should I sell?

If you bought the same stock at different times and prices, you get to choose which of those shares you're selling, and that choice can change your tax bill a lot. This compares the same sale under each cost-basis method, which basically just means each way of deciding which shares went out the door.

The sale
Your lots

Each time you bought this stock is a lot. Your broker's cost-basis or "unrealized gains" page lists them.

Lot 1
Lot 2
Lot 3

Lowest tax this year saves you this vs first in, first out

$0

MethodGain or lossShort termLong termEst. federal tax

    How the math works

    Each method picks which of your shares you're selling. Your gain is the sale price minus what you paid for those particular shares, and each lot's gain is short term or long term depending on how long you held it. Long term means more than a year. The IRS counts from the day after you bought, and the day you sell counts, so shares bought on January 15, 2025 are long term if sold on or after January 16, 2026.

    The tax on each is your 2026 federal tax with the sale minus your tax without it, using the 2026 brackets, the 0%, 15% and 20% long-term rates and the 3.8% net investment income tax.

    How you actually pick your shares

    To sell specific shares, you have to tell your broker which lots before the trade settles, and get a confirmation back. Usually that just means choosing the lot method, or the exact lots, on the sell screen before you place the trade. You can't go back and pick different shares after the fact.

    Mutual funds are stickier. Once you've sold shares of a fund using average cost, you can't take that back for the shares you already own: they keep their averaged cost even if you switch methods later.

    And the lowest tax this year can mean more tax later. The shares you don't sell are the ones with the lower cost, so the gain you skip today is still sitting there for the next sale. A lot of the time it's a deferral more than a discount. It still pays to look before you sell, though, because a long-term rate later usually beats a short-term rate now.

    What this leaves out

    State income tax, itemized deductions, credits, the alternative minimum tax, married filing separately, other gains and losses you've taken this year, and wash sales: if any of the shares you'd sell are at a loss and you bought more within 30 days, check the wash-sale rule.

    Watch

    Put this calculator on your site

    Copy this into your page. It stays free, and the numbers update when the tax tables do.

    Sources: IRS Publication 550 (holding period, identifying the shares you sold, first in, first out and average basis), Treas. Reg. §1.1012-1 (adequate identification before settlement in (c), and the average basis method and its election in (e)) and IRS Revenue Procedure 2025-32 (2026 brackets and capital gains rates). Last checked against these sources on Nov 9, 2026.

    An estimate for learning, not tax advice. I'm a CPA, but I'm not your CPA, so check with whoever does your taxes before you sell. Nothing you type leaves your browser. Full disclaimer.