Skip to main content
The Fennec Lab

Reviewed against IRC § 121 (full section); IRC § 121(a) (ownership and use tests); IRC § 121(b)(1)-(2) ($250K single / $500K MFJ caps); IRC § 121(b)(3) (one-sale-per-2-years limit); IRC § 121(b)(5) (non-qualified use post-2009); IRC § 121(c) (partial-exclusion safe harbors); IRC § 121(d)(2) (surviving-spouse 2-year extension); IRC § 121(d)(3) (divorce attribution of former spouse's ownership and use); IRC § 121(d)(6) (depreciation taken after May 6, 1997 not excluded); IRC § 121(d)(9) (10-year suspension for qualified official extended duty — military, foreign service, intelligence); Treas. Reg. § 1.121-1 (principal residence determination, ownership and use tests); Treas. Reg. § 1.121-2 (limitations); Treas. Reg. § 1.121-3 (partial-exclusion safe harbors — 50-mile employment, health, unforeseen circumstances); Treas. Reg. § 1.121-4 (special rules — death, divorce, nonresident aliens); IRC § 1(h)(6) and § 1250 (unrecaptured § 1250 gain at 25%); IRC § 1411 (Net Investment Income Tax 3.8%); IRS Publication 523 (Selling Your Home); IRS Form 8949 and Schedule D (sale reporting); Rev. Rul. 2002-12 (partial-exclusion examples)

Federal Section 121 Primary Residence Exclusion Calculator

Compute the IRC § 121 primary-residence capital-gains exclusion — $250,000 single / $500,000 married-filing-jointly — on the sale of your principal residence, with the depreciation-recapture carve-out under § 121(d)(6), the non-qualified-use proration under § 121(b)(5), the partial-exclusion safe harbor under § 121(c), and the NIIT stack under IRC § 1411. Surfaces the realized gain, eligibility-test status, effective exclusion, taxable gain, depreciation-recapture liability, and the NIIT-subject base in a single planning view. Federal-pure mechanics: applies in any jurisdiction.

Calculator

Adjust the inputs below; the result updates instantly.

Sale

$1,200,000
$500,000

Your federal filing status for the year of sale. The IRC § 121 cap is $250,000 for single filers (and married filing separately) and $500,000 for married filing jointly under IRC § 121(b)(1)–(2). Joint filers must satisfy three conditions for the $500K cap under IRC § 121(b)(2)(B): at least ONE spouse meets the ownership test, BOTH spouses meet the use test, and NEITHER spouse used § 121 on another sale within the prior 2 years. If only one spouse meets the use test, the joint return is limited to the single-filer $250K cap.

Tests

10
10

Adjustments

0
$0

If you do NOT meet the 2-year ownership/use tests OR you used § 121 within the prior 2 years, you may still claim a partial exclusion under IRC § 121(c) and Treas. Reg. § 1.121-3 if the sale was triggered by a qualifying reason: (a) change in place of employment (safe harbor under § 1.121-3(c)(2) when the new job is at least 50 miles farther from the residence than the prior employment); (b) health (physician recommends a move to obtain, provide, or facilitate medical care under § 1.121-3(d)); or (c) unforeseen circumstance (per se safe harbors under § 1.121-3(e) include death of a household member, divorce or legal separation, qualifying unemployment, multiple births, natural disaster, and involuntary conversion). Choose 'None' if the full tests are met OR no qualifying reason applies. The partial cap is computed as (months actually occupied / 24) × the full filing-status cap.

Effective § 121 exclusion

$500,000.00
Realized gain
$700,000.00
Maximum § 121 exclusion cap
$500,000.00
Depreciation recapture (25% unrecaptured § 1250)
$0.00
NIIT-subject gain base (3.8% if MAGI above § 1411 threshold)
$200,000.00
Eligibility-test compliance
Ownership test (≥2 yrs): met · Use test (≥2 yrs): met · 2-year reuse window: clear · Full exclusion eligible.
Summary
Sale price $1,200,000 minus adjusted basis $500,000 yields a realized gain of $700,000. You meet both the 2-of-5 ownership and use tests under IRC § 121(a) and have not used § 121 within the prior 2 years, so the full $500,000 married filing jointly cap is available. The effective § 121 exclusion is $500,000, leaving $200,000 of taxable gain. NIIT-subject (LTCG-rate) portion: $200,000.

Tools to go with this

Planning a primary-residence sale? Lock in the § 121 exclusion before closing.

Fennec Press's federal tax planning bundle includes the IRC § 121 eligibility-test worksheet, the partial-exclusion safe-harbor decision tree under Treas. Reg. § 1.121-3, the depreciation-recapture allocation memo for home-office and rental-conversion properties under § 121(d)(6), the non-qualified-use proration worksheet under § 121(b)(5), the IRC § 121(d)(9) military 10-year suspension election guide, the divorce-attribution rule under § 121(d)(3), and the NIIT stack memo under § 1411 — built for sellers and the CPAs and real-estate attorneys who advise them.

Open Fennec Press tax planning bundle

Fennec Press is our sister site. Outbound link is UTM-tagged and disclosed.

How this calculator works

IRC § 121 is the single most valuable tax benefit available to ordinary American homeowners. It lets a filer exclude up to $250,000 (single) or $500,000 (married filing jointly) of capital gain on the sale of a property owned AND used as a principal residence for at least 2 of the 5 years ending on the date of sale. The exclusion is permanent — the excluded gain is gone from the federal tax base forever, not deferred — and reusable once every two years under IRC § 121(b)(3).

Importantly, the § 121 exclusion stacks ON TOP of cost basis. The total tax-free amount on a long-held appreciated home is basis (purchase price + capitalized improvements − depreciation) PLUS the exclusion. A couple who bought a home for $300,000 in 1995, put $100,000 of improvements into it over 25 years, and sold for $1,200,000 has a realized gain of $800,000 — and pockets $900,000 tax-free ($400K basis + $500K MFJ exclusion). The remaining $300K of gain is taxable at the long-term capital gains rate, with NIIT on top if MAGI is above the threshold.

This calculator models the full § 121 mechanic in a single planning view: the realized gain, the three eligibility tests, the partial-exclusion safe harbor under § 121(c), the depreciation-recapture carve-out under § 121(d)(6), the non-qualified-use proration under § 121(b)(5), and the NIIT-subject base for the § 1411 stack.

The 2-of-5 ownership and use tests

Under IRC § 121(a), to claim the full exclusion the taxpayer must satisfy two parallel tests:

  1. Ownership test. Owned the property for at least 2 years within the 5-year period ending on the sale date.
  2. Use test. Used the property as a principal residence for at least 2 years within the same 5-year period.

The two years do not need to be continuous. A homeowner who owns and lives in a property for 18 months, rents it for 6 months, then moves back in for another 6 months has met both tests. Short absences (vacation, business travel) do not break the use period under Treas. Reg. § 1.121-1(b)(4). Use as a vacation home, second home, or rental does NOT count toward the use test — only periods when the property was actually the taxpayer's principal residence.

The principal-residence determination is fact-intensive but typically follows where the taxpayer actually lives most of the year, with secondary factors like driver's license, voter registration, vehicle registration, mailing address for tax returns, and the location of family and bank accounts.

A third test runs alongside the 2-of-5 rule: IRC § 121(b)(3) prohibits using the exclusion on more than one sale within any 2-year period. A taxpayer who used § 121 on a sale 18 months ago is not eligible for another full exclusion today, even if they meet the 2-year ownership and use tests on the current property. A partial exclusion under § 121(c) may still be available if a qualifying reason triggered the early second sale.

Worked example 1 — MFJ, full exclusion, long-held home

A Florida couple files jointly. They sell their long-held home for $1,200,000 with an adjusted basis of $500,000 ($300K purchase price + $200K of improvements over the years, no depreciation). They lived in the home for 10 years.

  • Realized gain: $1,200,000 − $500,000 = $700,000
  • Maximum § 121 exclusion (MFJ): $500,000
  • All tests met: ownership ✓, use ✓, reuse ✓ → full $500,000 exclusion
  • Taxable gain: $700,000 − $500,000 = $200,000
  • Depreciation recapture: $0
  • NIIT-subject gain: $200,000

Federal tax bill: $200,000 × 15% LTCG = $30,000 of long-term capital gains tax. Plus $200,000 × 3.8% NIIT = $7,600 if MAGI is over the $250K MFJ threshold. Total federal tax: roughly $37,600 on a $700K gain — an effective rate of 5.4% on the gross gain, thanks to the § 121 exclusion that sheltered $500K of it.

Worked example 2 — single seller, partial exclusion for job relocation

A single seller relocates for a new job that is more than 50 miles from her old commute. She sells her home for $800,000 with an adjusted basis of $300,000. She lived in the home for 18 months before the relocation — short of the 2-year use test.

  • Realized gain: $800,000 − $300,000 = $500,000
  • Maximum § 121 exclusion (single): $250,000
  • Use test FAILS (18 months < 24 months) — no full exclusion available.
  • Partial-exclusion safe harbor: change of employment ≥50 miles → qualifies under Treas. Reg. § 1.121-3(c)(2).
  • Partial cap: 18 / 24 × $250,000 = $187,500
  • Effective exclusion: $187,500
  • Taxable gain: $500,000 − $187,500 = $312,500

Federal tax: $312,500 × 15% LTCG = roughly $46,875 (plus NIIT at 3.8% on the post-exclusion portion if MAGI is above the $200K single threshold — $312,500 × 3.8% = $11,875). Total federal tax: roughly $58,750. Without the partial-exclusion safe harbor, the full $500K gain would have been taxable — an additional $28,125 of federal tax avoided by qualifying under § 121(c).

Worked example 3 — non-qualified use (rental conversion to primary)

A single seller bought a property in 2014 for $200,000 and rented it out for 2 years, then converted it to a primary residence and lived in it for 3 years. She sells in 2019 for $600,000. No depreciation taken (or assume fully accounted for in basis).

  • Realized gain: $600,000 − $200,000 = $400,000
  • Maximum § 121 exclusion (single): $250,000
  • All eligibility tests met: ownership ✓ (5 yrs), use ✓ (3 yrs), reuse ✓.
  • Non-qualified use ratio under § 121(b)(5): 2 yrs rental ÷ 5 yrs owned = 40%
  • Qualified gain portion: $400,000 × (1 − 0.40) = $240,000
  • Effective exclusion: min($250,000 cap, $240,000 qualified portion, $400,000 gain) = $240,000
  • Taxable gain: $400,000 − $240,000 = $160,000

The non-qualified-use rule under § 121(b)(5) caps the exclusion at the qualified portion of the gain. Even though the seller would otherwise be eligible for the full $250K single cap, the 40% non-qualified ratio limits the actual exclusion to $240K — the portion of the gain attributable to qualified use. If the same property had been a primary residence for the full 5 years (no rental period since 2009), the full $250K cap would have been available, and the taxable gain would have been $150K rather than $160K. The $10K difference is the cost of the 2-year pre-conversion rental period.

The important carve-out: periods AFTER the last use as principal residence — e.g., the owner moved out and rented for 18 months immediately before sale — are NOT counted as non-qualified use under § 121(b)(5)(C)(ii)(I). The rule only catches investment-use periods BEFORE the property became (or after it stopped being for an extended absence) a principal residence.

Worked example 4 — home-office depreciation recapture

An MFJ couple owned and lived in their home for 12 years. For 10 of those years, one spouse took a home-office deduction that included depreciation totaling $50,000 (deducted on Form 8829, line 41, against Schedule C self-employment income). They sell for $900,000 with an adjusted basis of $400,000 (already reduced by the $50K depreciation).

  • Realized gain: $900,000 − $400,000 = $500,000
  • All eligibility tests met: ownership ✓, use ✓ (the home was their principal residence throughout — home-office use does not break primary-residence status), reuse ✓.
  • Depreciation recapture (IRC § 121(d)(6)): $50,000 × 25% = $12,500 of unrecaptured § 1250 gain tax — regardless of any § 121 exclusion on the remaining gain.
  • Gain after depreciation: $500,000 − $50,000 = $450,000 § 121-eligible base.
  • Effective § 121 exclusion: min($500,000 MFJ cap, $450,000, $500,000) = $450,000
  • Taxable gain after § 121: $500,000 − $450,000 = $50,000 (the depreciation portion).

Total federal tax: $12,500 of § 1250 recapture (the $50K depreciation taxed at 25%). The remaining $450K of gain is fully sheltered by the MFJ exclusion. The lesson for home-office filers: actual depreciation taken under the regular-method home-office deduction creates a 25% recapture liability at sale that the deduction's annual benefit must outweigh. The simplified home-office method ($5/sq ft, capped at $1,500/year) under Rev. Proc. 2013-13 explicitly disallows depreciation and therefore avoids the recapture problem entirely — making it the better choice for homeowners who anticipate a sale within the holding period.

How short occupancy plays out

The 2-of-5 rule under IRC § 121(a) is unforgiving. Short of 2 years means no full exclusion — and short of 2 years with no qualifying § 121(c) reason means no exclusion at all, full or partial. Some common gotchas:

  • 1 day shy of 2 years. A homeowner who closes a sale exactly 1 day before the 2-year anniversary fails the test. The calculator and the statute treat this as a complete failure, not a near-miss. Time the closing date carefully.
  • 23 months and one qualifying reason. With a partial-exclusion safe harbor, 23 months produces a partial cap of 23 / 24 × the full cap — $239,583 for a single filer, $479,166 for MFJ. The proration is linear and unfavorable to short occupancy.
  • 2 years exactly. The statute uses "during periods aggregating 2 years or more" — exactly 2 years satisfies the test.
  • More than 2 but spread out. Treas. Reg. § 1.121-1(c)(1) treats the 2-year requirement as aggregated days, not continuous years. A homeowner who lived in the home for 14 months, traveled for 6 months, lived another 12 months — total 26 months — has met the use test.

Military 10-year suspension under § 121(d)(9)

Under IRC § 121(d)(9), enacted by the Military Family Tax Relief Act of 2003 and expanded in 2006, qualified individuals on "qualified official extended duty" may elect to suspend the 5-year lookback for up to 10 years during periods of qualifying duty. The effective lookback can extend to as much as 15 years (the standard 5 + up to 10 years of suspension).

Qualified individuals include:

  • Members of the uniformed services (Army, Navy, Air Force, Marine Corps, Space Force, Coast Guard, NOAA Corps, Public Health Service Commissioned Corps).
  • Members of the Foreign Service of the United States.
  • Certain employees of the intelligence community.

Qualified official extended duty means stationed at a duty station at least 50 miles from the residence or residing under government orders in government quarters. The election is made on the return for the year of sale and is irrevocable for that sale.

This provision is enormously valuable for service members who own a home in one location and are deployed elsewhere for extended periods. Without it, the 5-year lookback would frequently expire during a long deployment and the § 121 exclusion would be lost. A service member deployed for 8 of the last 10 years who returns to sell the home can effectively use a 15-year lookback to satisfy the 2-of-5 tests.

Divorce and death-of-spouse rules

Under IRC § 121(d)(3), in a divorce situation, ownership and use by EITHER spouse — including by a former spouse pursuant to a divorce or separation instrument — is attributed to the other spouse for purposes of the 2-year tests. A spouse who acquires the home as part of a divorce settlement inherits the other spouse's ownership and use history. This prevents the § 121 exclusion from being lost by reason of a divorce-related property transfer.

Under IRC § 121(d)(2), a surviving spouse who sells a former marital home within 2 years of the deceased spouse's death may use the $500,000 MFJ cap (rather than the $250,000 single cap) IF (a) the surviving spouse has not remarried and (b) the deceased spouse met the use test before death. This 2-year window is a one-time grace period — sales after 2 years revert to the single-filer cap. A surviving spouse with a long-held home and a significant unrealized gain should evaluate whether to sell within 24 months of the spouse's death to preserve the $500K MFJ cap.

Common errors and pitfalls

  • Assuming the exclusion stacks twice in 2 years. It does not. IRC § 121(b)(3) caps usage at one sale per 2-year period. A taxpayer who sold one home with a $250K exclusion 18 months ago is not eligible for another full exclusion today.
  • Missing the non-qualified-use proration. A taxpayer who rented a property for several years before converting to a primary residence must compute the non-qualified ratio under § 121(b)(5). Skipping this step overstates the exclusion and underreports the taxable gain.
  • Forgetting depreciation recapture. A homeowner who took a regular-method home-office deduction or briefly rented the property owes 25% recapture on the cumulative depreciation, regardless of any § 121 exclusion on the remaining gain. This is a separate tax from the LTCG and NIIT on the post-exclusion taxable gain.
  • Mismatching the joint-filer test. The $500K MFJ cap requires BOTH spouses to meet the use test. A recently-married couple with one spouse who just moved into the home is limited to the $250K single cap until the new spouse satisfies the 2-year use test.
  • Computing basis incorrectly. Basis is the single most common audit adjustment on primary-residence sales. Capitalize improvements that add value or extend useful life (IRC § 1016, Treas. Reg. § 1.263(a)-3); do NOT capitalize routine repairs, refinancing costs, mortgage interest, or property taxes.
  • Confusing the § 121 exclusion with § 1031 like-kind exchange. § 121 is for primary residences and is a permanent exclusion. § 1031 is for investment property and is a deferral, not an exclusion. The two are not interchangeable.

This calculator produces planning estimates only. The eligibility-test outputs reflect the statutory thresholds without evaluating the fact-intensive determinations (principal-residence status, qualifying-reason qualification, contemporaneous documentation). Consult a CPA or federal-tax attorney before filing a return that relies on a partial-exclusion safe harbor or a non-qualified-use allocation.

FAQ

Common questions

Edge cases and clarifications around federal section 121 primary residence exclusion calculator.

IRC § 121 lets a homeowner exclude up to $250,000 (single filer or married filing separately) or $500,000 (married filing jointly) of capital gain on the sale of a property that has been owned AND used as a principal residence for at least 2 of the 5 years ending on the date of sale. The exclusion is permanent — the excluded gain is gone from the federal tax base forever, not deferred — and reusable once every two years under IRC § 121(b)(3). It stacks ON TOP of cost basis, so a long-held appreciated home where the owner put $200K into improvements and lived in it for 25 years can shelter $500K-plus of gain at sale.

Resources

Links marked sponsoredmay earn The Fennec Lab a commission. They do not affect the calculator's output. See disclosures.

Related calculators

Search calculators

Find a calculator by name, cluster, or statute