How the home sale exclusion works

Under Section 121, you can exclude up to $250,000 of gain from selling your main home — $500,000 if you're married filing jointly — provided you owned the home and used it as your principal residence for at least 24 months out of the five years ending on the sale date. For a joint return, only one spouse needs to meet the ownership test, but both must meet the use test.

Those dollar limits were set in 1997 and have never been indexed for inflation. Homes in coastal California, the New York suburbs, and the Seattle area have tripled or quadrupled since — which is why a rule designed to exempt most sellers now leaves many with substantial taxable gain.

Basis is where people lose money

Your gain is measured against adjusted basis, not purchase price, and most sellers understate it badly. Basis includes what you paid, certain costs of buying, and every capital improvement you made over the years — the addition, the kitchen remodel, the roof, the HVAC system, the deck, the finished basement. Repairs and maintenance don't count; improvements that add value or extend the home's life do.

Twenty years of improvements on a family home routinely total six figures. Reconstruct the number with receipts where you have them, and with credible documentation where you don't — permits, contractor records, credit card statements, before-and-after photos. Every dollar of documented improvement is a dollar of gain you don't pay tax on. IRS Publication 523 covers what qualifies.

The four things that shrink or void the exclusion

Depreciation you claimed. Any depreciation taken after May 6, 1997 for a home office or rental period cannot be excluded. It's taxed as unrecaptured Section 1250 gain at rates up to 25%, separate from the exclusion entirely.

Non-residence periods after 2008. If the home was a rental or second home before becoming your principal residence, the portion of gain allocable to that 'nonqualified use' may not qualify for the exclusion.

A home acquired through a 1031 exchange. If you obtained the property in a like-kind exchange, the exclusion is unavailable if you sell within five years of acquiring it that way. This catches investors who convert a rental into a residence and sell too soon.

Using the exclusion twice in two years. It's generally available only once in any 24-month period.

What if the taxable gain is large?

Here's what surprises homeowners who've researched investment property: almost none of the familiar deferral tools apply to a primary residence. Section 1031 covers real property held for investment or business use — a home you live in is personal-use property and doesn't qualify. Delaware Statutory Trusts inherit that same limitation, since they're a 1031 replacement vehicle.

What does apply is the installment method. IRC §453 doesn't care what kind of property it is — if part of the price is received in later years under a qualifying arrangement, the gain above your exclusion can be recognized as payments arrive rather than all at once. Your Section 121 exclusion is applied first and comes out of the calculation entirely; only the excess spreads across the schedule. The arrangement has to be in the purchase agreement before closing, though — a seller who closes for cash has already recognized the gain.

What this calculator doesn't do

It computes the straightforward case: gain, exclusion, taxable remainder. It does not calculate your actual tax bill — that depends on your income, filing status, the 3.8% net investment income tax, and your state. It doesn't compute a partial exclusion, allocate gain for nonqualified use periods, or quantify depreciation recapture. And it can't tell you whether a particular improvement qualifies as a capital improvement.

If any warning appeared above your result, the honest answer is that your situation needs a CPA's math, not a web form's.

Frequently asked questions

How much gain can I exclude when selling my home?

Up to $250,000 if you file single, or $500,000 married filing jointly, provided you owned and used the home as your principal residence for at least 24 months out of the five years before the sale. Gain above that is taxable capital gain.

What counts toward my basis when selling a home?

The purchase price, certain purchase costs, and capital improvements — additions, remodels, a new roof, HVAC replacement, and similar work that adds value or extends the home's life. Routine repairs and maintenance don't count. Selling costs like agent commission reduce your amount realized.

Can I do a 1031 exchange on my primary residence?

No. Section 1031 applies only to real property held for investment or business use, so a home you live in doesn't qualify. The installment method under IRC §453 is one of the few deferral tools available to home sellers.

Do I lose the exclusion if I spread the sale over installments?

No. The Section 121 exclusion is applied first and the excluded gain is removed from the calculation entirely — only the gain above the exclusion is spread across the payment schedule.

Sources

Last reviewed: August 10, 2026.

This tool is for general education only and is not tax, legal, or investment advice. Home sale exclusion eligibility and basis calculations are fact-specific. Consult your CPA before acting.