🏠Home Sale Capital Gains Calculator

Calculate capital gains tax with primary home exemption

$
$
$
$
$
years
years
%

How the home sale exclusion works

Selling your main home does not automatically trigger capital gains tax. Section 121 lets you exclude a fixed amount of gain if you owned the home and lived in it as your main home for at least two of the five years before the sale, with a larger amount available to joint filers.

This calculator starts from the amount realized after selling costs, subtracts an adjusted basis that adds capital improvements and removes any depreciation you claimed, then splits the gain: depreciation taken after May 6, 1997 is taxed separately as unrecaptured Section 1250 gain, and only the remainder is eligible for the exclusion.

Basis and date — the exclusion is 26 U.S.C. sec. 121, the ownership and use tests are in sec. 121(a), and the maximum rate on unrecaptured Section 1250 gain is in sec. 1(h)(1)(E). The exclusion amounts are fixed by statute rather than indexed for inflation. Content reflects September 2026.

This tool gives a general estimate and does not determine your actual tax. The Net Investment Income Tax, state taxes, partial exclusions for unforeseen circumstances, nonqualified use periods and inherited basis can all change the result, so review the sale with a tax professional.

Frequently asked questions

Do I have to buy another home to avoid the tax?

No. The old rollover rule was replaced decades ago. The Section 121 exclusion applies on its own once the ownership and use tests are met, whether or not you buy again, and it can generally be used once every two years.

Why is depreciation taxed even though I qualify for the exclusion?

Depreciation taken after May 6, 1997 cannot be excluded under Section 121. That portion of the gain is unrecaptured Section 1250 gain, taxed at its own maximum rate, which is why it is shown separately here.

What if I lived there less than two years?

The full exclusion is not available, but a partial exclusion may apply if the sale was due to a work relocation, health reasons or other unforeseen circumstances listed in the regulations. This calculator shows the no-exclusion result in that case.