Want to understand the ownership and use tests, partial exclusion rules, and how section 1250 depreciation recapture works before you calculate? The Home Sale §121 Exclusion Guide covers the full doctrine.
Read the Guide →
Short Answer
If you owned and used your home as your principal residence for at least 2 of the past 5 years, IRC section 121 excludes up to $250,000 of gain (single) or $500,000 (married filing jointly) from federal income tax. Gain above the exclusion limit is taxed as a long-term capital gain at 0, 15, or 20 percent depending on your total income under Rev. Proc. 2025-32, with any section 1250 unrecaptured gain (from prior depreciation) taxed at a maximum 25 percent rate. If the gain is fully excluded, no capital gains tax or net investment income tax applies.
Key Takeaways
- IRC §121 exclusion: $250,000 single / $500,000 MFJ. MFJ requires both spouses to meet the 2-year use test; either spouse can meet the ownership test.
- Ownership and use tests: must have owned AND used the home as your principal residence for at least 24 months (in any 2-year period) within the past 5 years.
- Adjusted basis = purchase price + acquisition costs + improvements - depreciation. Not your current market value or refinanced appraised value.
- Section 1250 unrecaptured gain (from prior depreciation) is taxed at a maximum 25% federal rate, separate from the LTCG rate on the rest of the gain.
- 2026 LTCG rates (Rev. Proc. 2025-32): 0% up to $49,450 single / $98,900 MFJ; 15% up to $545,500 single / $613,700 MFJ; 20% above those ceilings.
- NIIT (3.8%, IRC §1411): applies only to non-excluded gain for taxpayers above $200,000 single / $250,000 MFJ. Fully excluded gain is NIIT-exempt.
- Partial exclusion available if sale was due to change in employment, health, or unforeseen circumstances and you did not meet the full 2-year test.
- Exclusion can be used only once every 2 years. If you used it on a prior home sale within 2 years, you are disqualified from using it again.
- Losses on personal-use primary residence are not deductible. Report the sale on Form 8949 + Schedule D if you received Form 1099-S or have taxable gain.
How This Calculator Works
Step 1 - Adjusted Basis
Adjusted basis = purchase price + purchase closing costs + permanent improvements - cumulative depreciation claimed. Improvements include additions, structural upgrades, and major systems replacements. Maintenance and repairs do not increase basis. Depreciation reduces basis by the total amount you claimed (or were allowed to claim) for any rental use or home office deduction.
Step 2 - Amount Realized
Amount realized = sale price - selling expenses. Selling expenses include real estate commissions, seller-paid closing costs, title fees, and transfer taxes paid from the sale proceeds.
Step 3 - Realized Gain
Realized gain = amount realized - adjusted basis. If the result is negative (a loss), no gain tax applies. A personal-use property loss is not deductible.
Step 4 - Section 121 Exclusion
If you are fully qualified, the calculator applies the full $250,000 / $500,000 exclusion against realized gain. For partial qualification, the calculator applies the reduced exclusion: max exclusion × (qualifying months / 24). No exclusion is applied if you are not qualified.
Step 5 - Section 1250 Unrecaptured Gain
If you entered prior depreciation, the calculator identifies the section 1250 unrecaptured gain as the lesser of: (1) total depreciation claimed, or (2) the taxable gain after exclusion. This portion is taxed at a maximum 25% federal rate.
Step 6 - Long-Term Capital Gains Rate
The remaining taxable gain (after the §1250 portion) is taxed at the applicable LTCG rate. The calculator stacks your ordinary income below the gain, then applies the 0/15/20% thresholds from Rev. Proc. 2025-32 to the LTCG portion.
Step 7 - Net Investment Income Tax
The calculator estimates NIIT at 3.8% on the lesser of: (1) the total non-excluded taxable gain, or (2) the amount by which your estimated AGI (other income + taxable gain) exceeds the NIIT threshold ($200,000 single / $250,000 MFJ). Gain that is fully excluded under §121 is not subject to NIIT.
Worked Example: Couple Selling After 8 Years
Setup (2026, Married Filing Jointly)
Sale price$900,000
Selling expenses (agent + closing)$45,000
Amount realized$855,000
Original purchase price (2018)$400,000
Purchase closing costs$10,000
Permanent improvements$60,000
Prior depreciation (none - pure primary residence)$0
Adjusted basis$470,000
Realized gain$385,000
Section 121 Exclusion (Fully Qualified MFJ)
Maximum MFJ exclusion$500,000
Exclusion applied$385,000
Taxable gain after exclusion$0
In this example, the entire $385,000 gain is excluded. Federal capital gains tax = $0. NIIT = $0 (excluded gain is not subject to NIIT).
Now suppose the couple had a $650,000 gain instead. The exclusion covers $500,000. The remaining $150,000 is taxed as a long-term capital gain. With other income of $120,000 (MFJ, 2026), taxable ordinary income is $120,000 - $32,200 standard deduction = $87,800. The $150,000 LTCG stacks on top. The 15% LTCG bracket runs to $613,700 MFJ; $87,800 ordinary income leaves $525,900 of 15% LTCG room remaining. The full $150,000 LTCG falls within the 15% bracket. LTCG tax = $22,500. NIIT: AGI = $120,000 + $150,000 = $270,000. NIIT threshold MFJ = $250,000. NIIT applies to lesser of $150,000 gain or $20,000 excess over threshold = $20,000 × 3.8% = $760. Total federal tax on the home sale: approximately $23,260.
Practitioner Insight
The two most overlooked basis items are purchase-closing-cost additions and prior depreciation reductions. Buyers rarely keep their HUD-1 or settlement statement from the original purchase, so when they sell 10 years later they understate their basis and overstate their gain by $8,000 to $20,000 in typical transactions. Pull the original closing disclosure before calculating. On the depreciation side: if you ever deducted a home office or rented a room for any period, IRS records show the depreciation allowed even if you stopped claiming it. The amount allowed (not just claimed) reduces basis. This catches taxpayers who "forgot" about a home office from 2016 to 2020 and then sell in 2026 assuming zero depreciation.
Real-World Scenario: Partial Rental Creates a Split Calculation
James bought a duplex in 2019, lived in one unit, and rented the other. He claimed $18,000 of depreciation on the rental unit over 6 years. He sold in 2026 for a $320,000 total gain.
The rental portion has its own rules. For the unit James occupied, he may qualify for the §121 exclusion on that portion (the personal-use share of the gain). For the rental unit, no §121 exclusion applies, and the $18,000 of prior depreciation is unrecaptured §1250 gain taxed at 25%. The remaining rental gain is taxed as LTCG. James files as single, with $85,000 of other ordinary income. His §1250 tax: $18,000 × 25% = $4,500. His remaining rental LTCG falls in the 15% bracket. The personal-use gain is fully excluded.
The split-use scenario is significantly more complex than a pure primary residence sale and typically requires a professional cost-basis allocation worksheet. This calculator handles the simplified case where the entire property was used as a primary residence.
When This Calculator Does Not Cover Your Situation
- Mixed-use (rental + primary residence): Requires allocation of gain between personal-use and rental portions. This calculator handles pure primary residence only.
- Home office deduction history: Even a partial home office reduces adjusted basis and triggers §1250 unrecaptured gain on the office portion. Enter total depreciation claimed in the depreciation field to approximate.
- Installment sales: If you are spreading the sale proceeds across multiple tax years, use Form 6252 and Publication 537 for the installment method. The §121 exclusion still applies but the gain recognition schedule differs.
- Nonqualified use before January 1, 2009: Periods of non-primary-residence use before 2009 are excluded from the nonqualified use ratio calculation (IRC §121(b)(5)(C)(i)). This calculator uses the simplified exclusion/no-exclusion approach.
- Like-kind exchange (1031 exchange): If you exchanged this property and received carryover basis, your adjusted basis is not the original purchase price. Use the carryover basis from the exchange.
- Inherited property: Heirs receive a stepped-up basis equal to the fair market value at the date of death. The §121 exclusion requires you to meet the ownership and use tests personally (deceased owner's period counts for ownership only, not use).
- State income tax: Not estimated. Most states with income tax conform to federal LTCG treatment, but rates and exclusion rules vary significantly. California, New York, and New Jersey tax all capital gains at ordinary income rates with no LTCG preference.
Quick Reference: 2026 Capital Gains Rates for Home Sale
2026 Long-Term Capital Gains Rates - Home Sale Taxable Gain (Rev. Proc. 2025-32)
| Rate | Single / HOH top taxable income | MFJ top taxable income |
| 0% | $49,450 (single) / $66,200 (HOH) | $98,900 |
| 15% | $545,500 (single) / $579,600 (HOH) | $613,700 |
| 20% | above $545,500 (single) | above $613,700 |
| 25% max | Section 1250 unrecaptured gain (prior depreciation) - all income levels | Section 1250 unrecaptured gain - all income levels |
| +3.8% NIIT | Single/HOH: AGI above $200,000 (not inflation-adjusted) | MFJ: AGI above $250,000 |
Source: IRS Rev. Proc. 2025-32 (LTCG brackets). IRC §1411 (NIIT thresholds - not inflation-adjusted). IRC §1(h)(1)(D) (§1250 max 25%).
FAQ: Home Sale Capital Gains Tax
Do I have to pay capital gains tax when I sell my home?
Not necessarily. IRC section 121 allows you to exclude up to $250,000 of gain (single) or $500,000 (married filing jointly) if you owned and used the home as your principal residence for at least 2 of the past 5 years. If the gain is fully covered by the exclusion, no capital gains tax is owed. If your gain exceeds the exclusion limit, the non-excluded portion is taxed as long-term capital gain at 0, 15, or 20 percent depending on your income, with any section 1250 unrecaptured gain (from prior depreciation) taxed at a maximum 25 percent rate.
What is the home sale exclusion for 2026?
The IRC section 121 exclusion allows you to exclude up to $250,000 of capital gain from the sale of your principal residence if you file as single, head of household, or married filing separately. Married couples filing jointly can exclude up to $500,000 if both spouses meet the 2-year use test and at least one spouse meets the 2-year ownership test. The exclusion limit has not changed since the Taxpayer Relief Act of 1997; it remains $250,000 / $500,000 for 2026.
What counts as a qualifying improvement to my basis?
Qualifying improvements are additions or upgrades that add value, prolong the useful life of the home, or adapt the property to new uses. Examples: room additions, new roof, HVAC system, kitchen or bathroom remodel, new windows, landscaping with permanent features, garage addition, water heater, flooring. What does NOT increase basis: painting, repairs that maintain existing condition, appliance purchases that are not affixed, lawn care, and general maintenance. Keep receipts for any improvement over $500. IRS Publication 523 Appendix A provides a basis worksheet.
What is section 1250 unrecaptured gain?
When you claim depreciation deductions on a property (for example, when using part of the home as a rental or home office), those deductions reduce your adjusted basis. When you sell, the IRS recaptures the benefit of those deductions through section 1250 unrecaptured gain, which is the portion of your total taxable gain attributable to prior depreciation. This gain is taxed at a maximum federal rate of 25 percent under IRC section 1(h)(1)(D), even if it would otherwise qualify as a long-term capital gain. It is separate from and stacks below the standard LTCG rate schedule.
Can I get a partial home sale exclusion?
Yes. IRC section 121(c) provides a reduced exclusion if you fail to meet the full 2-year test but sold due to change in employment, health reasons, or unforeseen circumstances. The reduced exclusion equals the maximum exclusion ($250,000 or $500,000) multiplied by a fraction: qualifying months as primary residence (up to 24) divided by 24. Example: if you lived there 12 months and sold for job relocation, your exclusion is 12/24 = 50% of the maximum. For a single filer: $250,000 × 50% = $125,000 partial exclusion.
Does the NIIT apply to my home sale?
Only on the non-excluded portion. Capital gain that is excluded under the section 121 home sale exclusion is NOT subject to the 3.8% net investment income tax under IRC section 1411. If your gain is fully covered by the $250,000 or $500,000 exclusion, NIIT does not apply at all. NIIT applies only to the taxable portion of gain that exceeds the exclusion, and only if your AGI exceeds $200,000 (single) or $250,000 (MFJ). These NIIT thresholds are not inflation-adjusted.
What if I sell at a loss?
A capital loss on the sale of your personal-use primary residence is not deductible. Unlike investment property losses, personal property losses do not qualify for capital loss treatment on Schedule D. You cannot claim a deduction, carry the loss forward, or offset other gains. If the home was used partly as a rental, you may be able to claim a loss on the rental portion. IRS Publication 523 covers the allocation rules for mixed-use properties.
How do I report a home sale on my tax return?
If you receive Form 1099-S (Proceeds From Real Estate Transactions), you must report the sale even if the gain is fully excluded. Report the sale on Form 8949 and carry the result to Schedule D. If the gain is fully excluded, enter zero taxable gain and note the exclusion in the appropriate column of Form 8949. If you qualify for full exclusion and did not receive Form 1099-S, you may omit the sale from your return. Refer to IRS Publication 523 for the complete reporting rules.
Decision Step: Do You Need a Tax Professional for This Sale?
Route A - Calculator is sufficient
Your home was your sole primary residence for the full ownership period. No rental use, no home office, no periods of non-primary use. The gain is clearly under the exclusion limit ($250K single / $500K MFJ). You received no Form 1099-S, or you did receive one and the gain is fully excluded. File the sale on Form 8949 with the §121 exclusion noted.
Route B - Professional review recommended
Your gain exceeds or approaches the exclusion limit and the taxable portion could push you into the 20% LTCG rate or trigger NIIT. You claimed a home office deduction for any year. You rented any portion of the property at any point. You are selling a home received as a gift or inheritance. You have a complex ownership history (divorce, death of spouse, IRA-owned property, or trust ownership). You are using installment sale treatment. The §121 exclusion planning, §1250 recapture, and mixed-use allocation are all areas where professional cost-basis reconstruction commonly recovers far more than the professional's fee.
Disclaimer: This calculator provides federal tax estimates for educational purposes only. It does not constitute tax advice. Results assume a pure primary residence with no mixed-use allocation. Tax law is complex and individual circumstances vary. Consult a qualified tax professional or CPA before making decisions based on these estimates. National Tax Tools is not a tax advisory firm.