Monday, July 20, 2026 2026 Tax Year Edition

See the Math · Trust the Number · Every Figure Cites Its IRC Section

Advertisement
Calculator first — no scroll wall §121 exclusion built in Every number cites its IRC section

Capital Gains Tax on a Home Sale (2026)

Sell your primary home and the first $250,000 of gain ($500,000 married filing jointly) can be tax-free under IRC §121. This page shows exactly what is taxed, and a calculator that runs the math on your numbers.

Reviewed & updated · 2026 tax-year figures · Federal §121 exclusion & §1250 recapture

Quick answer

If you owned and lived in your home for at least 2 of the last 5 years, you can exclude up to $250,000 of gain if single, or $500,000 if married filing jointly, under IRC §121. Only gain above that exclusion is taxed — at long-term rates of 0%, 15%, or 20% (IRC §1(h)), plus the 3.8% NIIT for high earners. Gain is measured from your adjusted basis: purchase price + capital improvements + selling costs. If you ever rented the home, depreciation you claimed is recaptured at up to 25% (§1250) and cannot be excluded.

$250k/$500k
§121 exclusion
IRC §121
2 of 5 yrs
Own + use test
IRC §121(a)
Up to 25%
Deprec. recapture
IRC §1250
0/15/20%
LT rate on excess
IRC §1(h)
Home-Sale Capital Gains Estimate ✓ Engine verified against IRC §1(h)
The home & the sale
The §121 exclusion test

Full §121 exclusion applies: up to $250k / $500k of gain is tax-free.

Rental history (depreciation recapture)
Your tax picture 🔒 Nothing leaves your browser — all computation is client-side.
Home-Sale Tax ReceiptPrimary residence · MFJ · Tax Year 2026
Sale price$750,000
Less: adjusted basis–$505,000
Total gain$245,000
Less: §121 exclusion–$245,000
Taxable gain$0
Federal LT tax$0
Total tax
Net proceeds $750,000
$0
Effective rate on total gain: 0.0% · Marginal band: 0%
$505,000Basis returned $245,000Gain you keep $0Goes to tax
Show our work the exact math

Estimates only, for the 2026 tax year. Not tax advice. Dollar thresholds marked est. are projected 2026 figures, owner-verifiable against the final IRS release. State tax, AMT, and the 3.8% NIIT interaction with recapture can move your real number.

Advertisement

How does the §121 home-sale exclusion work?

When you sell your main home, IRC §121 lets you exclude a large chunk of the gain from tax entirely. A single filer excludes up to $250,000 of gain; a married couple filing jointly excludes up to $500,000. This is not a deduction you claim against income — it simply erases that slice of the gain before any capital-gains rate touches it. Only gain above the exclusion is taxed, and it is taxed at long-term rates because a home held long enough to qualify has by definition been held more than a year.

The full $500,000 joint exclusion requires that both spouses meet the use test and at least one meets the ownership test, and that neither excluded gain from another home sale in the prior two years. Details and worksheets are in IRS Publication 523 and IRS Topic No. 701.

What is the 2-out-of-5-year rule?

To claim the exclusion you must pass two tests during the five-year period ending on the sale date:

  • Ownership test — you owned the home for at least 24 months (2 years).
  • Use test — you lived in it as your main home for at least 24 months.

The months need not be continuous, and the ownership and use periods need not overlap — short absences (vacations, seasonal moves) still count as time lived in the home. You also generally cannot use the full exclusion if you claimed it on another home sale within the last two years. Fail the test with no qualifying reason, and no exclusion applies — the whole gain is taxable at long-term rates.

Rule of thumb: own it two years, live in it two years, and don't double-dip the exclusion within two years — hit all three and the first $250k/$500k of gain is yours, tax-free.
Advertisement

How do I calculate my adjusted basis?

Your taxable gain is measured from adjusted basis, not the raw purchase price — and a higher basis means a smaller gain. Per Pub 523:

ComponentEffectExamples
Purchase priceStarting pointContract price you originally paid
+ Capital improvementsIncreases basisNew roof, addition, kitchen remodel, HVAC, permanent landscaping
+ Selling costsIncreases basisAgent commission, title fees, transfer taxes, legal fees
− Depreciation takenDecreases basisDepreciation while rented (drives recapture)
= Adjusted basisUsed in gainSale price − adjusted basis = total gain

Routine repairs — repainting, fixing a leak, patching drywall — do not add to basis. Only improvements that add value, prolong the home's life, or adapt it to new uses count.

Can I get a partial exclusion if I move early?

Yes. If you sell before hitting the full two years because of a qualifying reason, §121 grants a prorated exclusion. Qualifying reasons include a work-related move (generally 50+ miles), a health-related move, or an unforeseeable event such as divorce, death, job loss with unemployment benefits, or multiple births from one pregnancy. The partial exclusion is your maximum exclusion times the fraction of qualifying months over 24.

Example: A married couple forced to relocate for work after 12 months gets 12/24 × $500,000 = $250,000 of exclusion — often still enough to wipe out the entire gain. Switch the calculator's exclusion setting to "Partial" to model this.

What about depreciation recapture on a rental?

If the home was ever a rental or had a home office you depreciated, the IRS takes back that tax benefit when you sell. Under IRC §1250, unrecaptured Section 1250 gain — the portion of gain attributable to depreciation you claimed — is taxed at a maximum federal rate of 25%. Two things make this sting:

  • Recaptured depreciation is not eligible for the §121 exclusion — even on a former primary residence, you owe on it.
  • Depreciation you were allowed is recaptured whether or not you actually claimed it, so skipping the deduction does not avoid the tax.
Watch out: a house you lived in, then rented out, is a mixed bag — the §121 exclusion can still shelter the appreciation gain, but every dollar of depreciation you took is clawed back at up to 25%. Enter it in the calculator's rental-history box to see the split.

How this calculator works & where the numbers come from

No black box. The tool follows the same sequence as the IRS worksheet in Publication 523: (1) adjusted basis = purchase price + improvements + selling costs − depreciation; (2) total gain = sale price − adjusted basis; (3) apply the §121 exclusion (full, partial, or none) against the appreciation gain, but never against depreciation recapture; (4) tax any remaining long-term gain across the 0/15/20% bands per IRC §1(h) by stacking it on your other taxable income; (5) tax unrecaptured §1250 gain at up to 25%; (6) add the 3.8% NIIT where modified AGI crosses the §1411 threshold.

FACT
CHECK
Reviewed and updated July 20, 2026 by the Capital Gains Ledger editorial desk against IRS Publication 523 (Selling Your Home), IRS Topic No. 701, and the statutory text of IRC §121, §1250, §1(h), and §1411. The 0/15/20% long-term engine passed unit tests covering multi-band 0/15 and 15/20 straddles, 20%-band spillover, and the NIIT threshold trigger.

Primary sources (linked, not just named)

Advertisement

Capital gains tax on a home sale, answered

How much is capital gains tax on the sale of a home?

On a primary residence you can exclude up to $250,000 of gain if single, or $500,000 if married filing jointly, under IRC §121, if you owned and lived there 2 of the last 5 years.

Only gain above the exclusion is taxed, at long-term rates of 0%, 15%, or 20% (§1(h)), plus the 3.8% NIIT for high earners. Gain is measured from adjusted basis = purchase price + improvements + selling costs.

What is the 2-out-of-5-year rule for home sales?

You must have owned the home and used it as your main home for at least 24 months during the 5-year period ending on the sale date. The ownership and use periods do not have to be continuous or overlap. You generally cannot claim the full exclusion more than once every two years.

How do I calculate the adjusted basis of my home?

Adjusted basis = original purchase price + capital improvements + selling costs, minus any depreciation taken (Pub 523). A new roof, an addition, or a remodel raise basis; routine repairs and maintenance do not. Selling costs like the agent commission and closing fees also count. A higher basis means a smaller taxable gain.

What is depreciation recapture on a rental home sale?

If you rented the home and claimed depreciation, that depreciation is recaptured when you sell. Unrecaptured Section 1250 gain is taxed at a maximum federal rate of 25% (§1250) and cannot be sheltered by the §121 exclusion, even on a former primary residence.

Can I get a partial home-sale exclusion if I move early?

Yes — if you sell before two years for a qualifying reason (work move, health, or an unforeseeable event like divorce or death), you get a prorated exclusion. It equals your maximum exclusion times the qualifying months of ownership and use divided by 24 (Pub 523).

Do I pay capital gains tax on an inherited home?

Inherited property generally gets a stepped-up basis equal to fair market value on the date of death (§1014), so selling soon after inheriting often produces little gain. The §121 exclusion applies only if you then use the home as your own main home for the required period. See how to reduce capital gains tax legally.

Why trust this over a bank calculator?

Most "home sale calculators" hand you a single scary number with no way to check it, gate the real answer behind an email, and never mention that a couple can shield a half-million dollars of gain. We flipped it. The tool loads first. It shows its arithmetic — adjusted basis, the exclusion applied, the bands your gain crosses, and any recapture. It links the actual statute. If a figure is a 2026 projection, we say so. That is the whole pitch.

One honest caveat: this is an estimate for the 2026 tax year, not a filing. State income tax, the interaction of NIIT with §1250 recapture, prior-home exclusion timing, non-qualified use periods, and stepped-up basis on inheritance can all move your real number. For a return, bring these figures to a CPA. See our full methodology.