Wealthy Habitat

Tools · Pay and taxes

Capital gains tax

The federal tax on gains, stacked on other income across the 0, 15, and 20 percent rates, with the 3.8 percent tax and a home sale. Type your numbers and the answer follows, with the formula beside it so you can redo it by hand. Nothing is stored and nobody is told what to do.

$
$
$
$

Home sale gain left out by the exclusion: $0. [smaller of the gain and $250,000] Source: home sale exclusion for 2026, single, $250,000, 26 U.S.C. 121(b)(1), exclusion of gain from sale of principal residence, read November 2026.

Home sale gain that is taxed: $0. [gain − the part left out, taxed as a long term gain]

Long term gain taxed at 0 percent: $0. [the part of the gains that falls below $49,450 of taxable income, after the other income and short term gains] Sources: top of the 0 percent band for 2026, single, $49,450, IRS Rev. Proc. 2025-32, section 4.03, read November 2026; capital gains rate for 2026, 0 percent, IRS Topic no. 409, Capital gains and losses, read November 2026.

Long term gain taxed at 15 percent: $20,000. [the part that falls from $49,450 to $545,500] Sources: top of the 15 percent band for 2026, single, $545,500, IRS Rev. Proc. 2025-32, section 4.03, read November 2026; capital gains rate for 2026, 15 percent, IRS Topic no. 409, Capital gains and losses, read November 2026.

Long term gain taxed at 20 percent: $0. [the part that falls above $545,500] Source: capital gains rate for 2026, 20 percent, IRS Topic no. 409, Capital gains and losses, read November 2026.

Tax on long term gains: $3,000. [15% × the part at 15 percent + 20% × the part at 20 percent]

Tax on short term gains at ordinary rates: $0. [rate table on (other income + short term gains) − rate table on other income] Source: tax rate table for 2026, single, IRS Rev. Proc. 2025-32, section 4.01, Table 3, unmarried individuals other than surviving spouses and heads of households, read November 2026.

Net investment income tax: $0. [3.8% × smaller of the gains and (income before deductions − $200,000)] Income before deductions is taken as taxable income plus the year's standard deduction. Sources: net investment income tax rate for 2026, 3.8 percent, IRS Topic no. 559, Net investment income tax, read November 2026; net investment income tax start for 2026, single, $200,000, IRS Topic no. 559, Net investment income tax, read November 2026.

Federal tax the gains add: $3,000. [short term + long term + net investment income tax]

Federal tax with the gains: $10,912. [rate table on other income + what the gains add, the net investment income tax included]

Gains are net, after losses; a net loss is not handled here. Long term gains, and the taxed part of a home sale, sit on top of the other taxable income and are taxed at 0, 15, and 20 percent by where they fall, as the IRS worksheet stacks them; qualified dividends are taxed the same way and can be added to the long term gains. It leaves out gains taxed at higher rates: collectibles, part of the gain on qualified small business stock, and depreciation taken on real estate. The home sale exclusion assumes the home was owned and lived in as the main home for two of the five years before the sale and no exclusion was used on another sale in the two years before; the larger amount on a joint return also needs both spouses to have lived there. The net investment income tax is measured against income before deductions, taken here as taxable income plus the year's standard deduction. State taxes are not counted.

The numbers travel in the link itself; nothing is stored anywhere.

Was this useful? Counted, never signed.

A worked example

With tax year set to 2026, filing status set to single, short term gains (held a year or less) at $0, long term gains (held more than a year) at $20,000, other taxable income after deductions at $60,000, gain on selling a main home at $0: home sale gain left out by the exclusion comes to $0; home sale gain that is taxed comes to $0; long term gain taxed at 0 percent comes to $0; long term gain taxed at 15 percent comes to $20,000; long term gain taxed at 20 percent comes to $0; tax on long term gains comes to $3,000; tax on short term gains at ordinary rates comes to $0; net investment income tax comes to $0; federal tax the gains add comes to $3,000; federal tax with the gains comes to $10,912.

Tax year can be set to 2026 or 2027.

Filing status can be set to single, married filing jointly, married filing separately, or head of household.

What the formula says

Home sale gain left out by the exclusion. Smaller of the gain and $250,000. Source: home sale exclusion for 2026, single, $250,000, 26 U.S.C. 121(b)(1), exclusion of gain from sale of principal residence, read November 2026.

Home sale gain that is taxed. Gain − the part left out, taxed as a long term gain.

Long term gain taxed at 0 percent. The part of the gains that falls below $49,450 of taxable income, after the other income and short term gains. Sources: top of the 0 percent band for 2026, single, $49,450, IRS Rev. Proc. 2025-32, section 4.03, read November 2026; capital gains rate for 2026, 0 percent, IRS Topic no. 409, Capital gains and losses, read November 2026.

Long term gain taxed at 15 percent. The part that falls from $49,450 to $545,500. Sources: top of the 15 percent band for 2026, single, $545,500, IRS Rev. Proc. 2025-32, section 4.03, read November 2026; capital gains rate for 2026, 15 percent, IRS Topic no. 409, Capital gains and losses, read November 2026.

Long term gain taxed at 20 percent. The part that falls above $545,500. Source: capital gains rate for 2026, 20 percent, IRS Topic no. 409, Capital gains and losses, read November 2026.

Tax on long term gains. 15% × the part at 15 percent + 20% × the part at 20 percent.

Tax on short term gains at ordinary rates. Rate table on (other income + short term gains) − rate table on other income. Source: tax rate table for 2026, single, IRS Rev. Proc. 2025-32, section 4.01, Table 3, unmarried individuals other than surviving spouses and heads of households, read November 2026.

Net investment income tax. 3.8% × smaller of the gains and (income before deductions − $200,000). Income before deductions is taken as taxable income plus the year's standard deduction. Sources: net investment income tax rate for 2026, 3.8 percent, IRS Topic no. 559, Net investment income tax, read November 2026; net investment income tax start for 2026, single, $200,000, IRS Topic no. 559, Net investment income tax, read November 2026.

Federal tax the gains add. Short term + long term + net investment income tax.

Federal tax with the gains. Rate table on other income + what the gains add, the net investment income tax included.

Gains are net, after losses; a net loss is not handled here. Long term gains, and the taxed part of a home sale, sit on top of the other taxable income and are taxed at 0, 15, and 20 percent by where they fall, as the IRS worksheet stacks them; qualified dividends are taxed the same way and can be added to the long term gains. It leaves out gains taxed at higher rates: collectibles, part of the gain on qualified small business stock, and depreciation taken on real estate. The home sale exclusion assumes the home was owned and lived in as the main home for two of the five years before the sale and no exclusion was used on another sale in the two years before; the larger amount on a joint return also needs both spouses to have lived there. The net investment income tax is measured against income before deductions, taken here as taxable income plus the year's standard deduction. State taxes are not counted.

Rules behind it

Long term versus short term capital gains rates
The net investment income tax line
The home sale exclusion and its ownership and use test
Tax gain harvesting in a low bracket year

Nearby calculators