The 0%, 15% and 20% ladder
Long-term gains are taxed at 0% until total taxable income reaches $49,450 for a single filer, $98,900 for a married couple filing jointly or $66,200 for a head of household. Above that the rate is 15%, and 20% starts above $545,500 single, $613,700 joint or $579,600 head of household.
The bands are measured in total taxable income, not in the gain itself, and the gain is stacked on top of ordinary income. A single filer with $60,000 of taxable income from wages has no room left in the 0% band, so the first dollar of gain is taxed at 15% even though $50,000 of gain sounds small.
The table prints the gain band by band with the slice taxed in each, so a sale that crosses a threshold is charged at two or three rates rather than one. Room left in the 0% band is shown as its own line, because that is the figure anyone harvesting gains for free is actually looking for.
Short-term gains are ordinary income
Hold for a year or less and the gain is added to wages and taxed through the ordinary brackets, with no 0% band available. A $40,000 short-term gain on top of $60,000 of taxable income lands in the 22% band, not the 15% capital gains band.
The holding period starts the day after the purchase settles and runs to the day of sale, and it has to exceed one year. Buying on March 3 and selling on March 3 of the following year is still short term; one day later is long term.
The page prices both holding periods in a single table so the cost of the calendar is visible: the long-term line, the short-term line and the difference between them, with the surtax excluded from that comparison because it applies either way once modified AGI passes the threshold.
The 3.8% net investment income tax
Above $200,000 of modified adjusted gross income for a single filer or head of household, and $250,000 for a couple filing jointly, a 3.8% surtax applies to the smaller of net investment income or the amount over the threshold. The thresholds are not indexed, so more filers cross them each year.
Modified AGI is approximated on this page by adding the standard deduction back to taxable income and then adding any other investment income you enter, so above-the-line deductions are not captured exactly. The gain counted toward the surtax is the part of the gain that sits above the threshold once that MAGI includes the gain itself, and the table prints both numbers.
The charge on this page is only the surtax this sale causes, not the whole return's NIIT. Any tax already owed on your other investment income stays attached to that income, and the return-level total is reported separately, so the effective rate on this gain is not inflated by money it did not produce.
What is excluded
The main home exclusion removes up to $250,000 of gain from a sale, or $500,000 on a joint return, when the property was owned and used as a main residence for two of the previous five years. Qualifying small business stock, opportunity zone investments and 1031 exchanges defer or exclude gain in specific situations.
Losses are not netted here, because the page prices one gain. A real return offsets short-term losses against short-term gains first and then the other type, allows up to $3,000 of remaining net loss against ordinary income each year, and carries the rest forward.
State treatment sits outside the model too, and a few states tax gains as ordinary income with no preferential rate at all. This is one federal gain priced carefully, which is why it is a planning estimate rather than a return.