English

How much of your home sale gain is tax free

How much of the gain on selling your main home is tax free - the full or partial exclusion and the taxable gain, worked on the IRS's own Worksheets 1 to 3 (Publication 523, 2025).

The sale

When it was your main home

Every stretch you lived there, moved in to moved out. For the last one, put the sale date if you lived there until you sold.

If you fall short of 2 years

Where the method comes from

IRS Publication 523 (2025), Selling Your Home, read 2026-10-21 on irs.gov: the Eligibility Test (24 months owned and 24 months lived in out of the 5 years before the sale, and no exclusion in the 2 years before), Worksheet 1 ($250,000, or $500,000 married filing jointly; the partial limit is the shortest period divided by 730 days times $250,000, per spouse), Worksheet 2 (gain) and Worksheet 3 (depreciation after May 6, 1997 is never excluded, and rental or other non-home use after 2008, before you last lived there, takes a share of the gain by days). The tests run the publication's own Finley and Taylor examples. The publication rounds Finley to 2 of 5 years; counted in days, as its worksheet asks, it is 731 of 1,827, so this page shows $120,033 where the example says $120,000.

Not covered here - see Publication 523: divorce and surviving-spouse rules, the military, intelligence and Peace Corps "stop the clock" rule, a destroyed or condemned home, vacant land, remainder interests, and a home used partly for business (split into two worksheets). Not tax advice.

Worked example

The calculator’s own example, already worked through:

Filing statusSingle, head of household, or married filing separately
Date you bought it2020-01-01
Date of sale (closing)2025-01-01
Selling price ($)700000
Selling expenses - commissions, fees, legal ($)0
Basis - price paid, settlement costs and improvements, before depreciation ($)400000
Depreciation taken or allowed after May 6, 1997 - business or rental use ($)20000
You lived there from2022-01-01
until2024-01-01
Main reason you soldNot one of these
Got it in a like-kind (1031) exchange in the last 5 years, or the expatriate tax applies?No

Result: Taxable gain: $140,033 $179,967 of the $320,000 gain is excluded. $20,000 is depreciation, taxed as unrecaptured section 1250 gain. You qualify for the full $250,000 on your own.

Press Load an example above to see the same numbers in the calculator, with every step.

Last updated November 25, 2026. Made and checked by Progeny Infiniti LLC: every calculator is tested against the worked examples in the official source it names. How we build and check these calculators.

More in Taxes

Other Taxes calculators

See all 14 calculators in Taxes →Next: The kiddie tax on Form 8615, line by line →