tax-calculators
How to Calculate Capital Gains on a Home Sale and the $250,000 Exclusion
Learn how to calculate taxable gain when selling your home, how the Section 121 exclusion eliminates up to $500,000 in capital gains for qualifying homeowners, and what adjustments reduce your taxable basis.

Most homeowners who sell their primary residence owe zero in federal capital gains tax — because the Section 121 exclusion shields up to $250,000 in gain for single filers and $500,000 for married couples who meet the residency requirements. But the calculation that determines whether you owe anything is not simply the difference between your sale price and what you paid. Your adjusted basis includes purchase costs, capital improvements, and selling expenses, and getting it wrong in either direction costs money.
How the Section 121 Exclusion Works
Internal Revenue Code Section 121 allows homeowners to exclude up to $250,000 in capital gain from the sale of a primary residence ($500,000 for married couples filing jointly) from federal income tax. To qualify, you must have owned and used the home as your primary residence for at least 2 of the 5 years immediately before the sale. The 2-year ownership and 2-year use requirements are separate — you must meet both — but they do not need to be the same 2 years.
If you do not meet the full 2-year requirements because of a job relocation, health circumstance, or other unforeseen event, you may qualify for a partial exclusion proportional to the time you lived there. A seller with 18 months of residency who moved for a documented job change qualifies for 18/24 = 75% of the maximum exclusion ($187,500 single or $375,000 married). The exclusion can be used repeatedly — there is no lifetime cap — as long as you have not used it on another home within the past 2 years.
How the Calculation Works
The taxable gain is the net sale proceeds minus your adjusted basis. Getting the adjusted basis right requires tracking every dollar spent on the home beyond the purchase price — acquisition costs, capital improvements, and any past depreciation claimed. The exclusion is then subtracted from the gain, with any remainder taxed at long-term capital gains rates.
- Calculate adjusted basis: purchase price plus acquisition costs (origination fees, title insurance, recording fees, transfer taxes paid by buyer) plus capital improvements made during ownership (additions, renovations, major system replacements) minus any depreciation previously claimed for business use.
- Calculate net sale proceeds: sale price minus selling costs (real estate commissions, closing costs paid by seller, transfer taxes paid by seller, any concessions to buyer).
- Calculate realized gain: net sale proceeds minus adjusted basis.
- Apply the Section 121 exclusion: subtract $250,000 (single) or $500,000 (married) from realized gain. If the result is zero or negative, no federal capital gains tax is owed.
- Tax any remaining gain at long-term rates: 0% for taxable income below $47,025 (single, 2024), 15% for most middle-income earners, 20% for high earners. Gains qualify as long-term if held more than 1 year.
Key Factors That Influence the Result
- Capital improvements versus repairs — improvements that add value, extend useful life, or adapt the home to a new use (a new roof, an addition, a kitchen remodel) increase adjusted basis and reduce the taxable gain. Routine repairs and maintenance (painting, fixing a leaky faucet) do not.
- Home office or rental use — if any portion of the home was used for business and depreciation was claimed, that portion of the gain is subject to unrecaptured Section 1250 depreciation recapture tax at a maximum rate of 25%, even if the rest of the gain is excluded.
- Prior sale within 2 years — the exclusion cannot be used again if you sold another home and claimed the exclusion within the 2 years before the current sale.
- State capital gains tax — most states that have income taxes also tax capital gains, often without a separate exclusion matching the federal Section 121 benefit. Calculate state tax separately.
- Inherited homes — homes inherited receive a stepped-up basis equal to the fair market value at the date of death, effectively eliminating any gain that accrued during the original owner lifetime.
Practical Examples
These three scenarios show a married couple with a gain well within the exclusion, a single seller with a gain that partially exceeds the exclusion, and a seller who must sell before meeting the 2-year requirement.
- David and Ellen, married, sold their primary residence after 8 years. Purchase price: $285,000. Acquisition costs at purchase: $8,000. Capital improvements over 8 years: $35,000. Adjusted basis: $328,000. Sale price: $520,000. Selling costs (commission plus other fees): $31,200. Net proceeds: $488,800. Realized gain: $488,800 minus $328,000 = $160,800. Married exclusion: $500,000. Taxable gain: $0. David and Ellen owe nothing in federal capital gains tax despite a $160,800 gain because they are well within the $500,000 married exclusion.
- Susan, single, sold her primary residence after 12 years at $780,000. Original purchase price: $350,000. Acquisition costs: $7,000. Capital improvements: $45,000. Adjusted basis: $402,000. Selling costs: $50,800. Net proceeds: $729,200. Realized gain: $729,200 minus $402,000 = $327,200. Single exclusion: $250,000. Taxable gain: $327,200 minus $250,000 = $77,200. Susan earns $180,000 in total income, placing her in the 15% long-term capital gains bracket. Federal tax: $77,200 x 15% = $11,580. Without the $250,000 exclusion, her tax would have been $327,200 x 15% = $49,080 — the exclusion saves her $37,500 in federal taxes.
- Mark, single, bought his home 18 months ago for $420,000 and must sell due to a documented job relocation. Sale price: $495,000. Acquisition costs: $4,200. Selling costs: $29,700. Realized gain: $495,000 minus $424,200 minus $29,700 = $41,100. Mark does not meet the full 2-year requirement, but qualifies for a partial exclusion because the sale was caused by a job relocation. Partial exclusion: $250,000 x (18 months / 24 months) = $187,500. Taxable gain: max($0, $41,100 minus $187,500) = $0. Mark owes nothing because his gain is smaller than his partial exclusion — a key benefit of the partial exclusion rule that many sellers in his situation do not know about.
The David and Ellen example shows that most married homeowners who sell after several years of appreciation will be fully protected by the exclusion. Susan example shows how the exclusion eliminates 76% of her federal tax liability — $37,500 in savings — while still leaving $11,580 owed on the gain above the threshold. Mark example shows that even failing to meet the 2-year rule does not necessarily create a tax bill when the partial exclusion applies to a qualifying reason and the gain is modest.
Common Mistakes People Make
- Not tracking capital improvements — every unrecorded improvement reduces adjusted basis, which increases taxable gain; a $30,000 kitchen remodel with no documentation is $4,500 in unnecessary capital gains tax at the 15% rate.
- Forgetting acquisition and selling costs in the basis calculation — origination fees, title insurance, transfer taxes paid at purchase, and real estate commissions at sale all adjust the taxable gain; omitting them overstates the gain.
- Assuming the exclusion applies automatically without meeting requirements — you must have owned the property and lived in it as your primary residence for 2 of the 5 years before sale; investment properties, vacation homes, and rental properties do not qualify.
- Ignoring depreciation recapture on partial business use — any portion of the home depreciated for a home office or rental triggers recapture tax at up to 25% on the depreciated amount, even if the rest of the gain is fully excluded.
- Filing without Form 8949 when you have a taxable gain — a gain above the exclusion threshold must be reported on Schedule D and Form 8949; omitting it creates a discrepancy with Form 1099-S that the IRS receives from the settlement agent.
Why Using a Calculator Helps
A capital gains tax calculator computes the taxable portion of a home sale gain after applying the Section 121 exclusion, and applies the correct long-term rate based on total income — making the tax bill concrete before the sale closes.
- Calculate adjusted basis from purchase price, acquisition costs, and capital improvements.
- Determine the taxable gain after the Section 121 exclusion for single and married filers.
- Apply the correct long-term capital gains rate based on your expected total income in the sale year.
- Estimate the partial exclusion for sellers who do not meet the full 2-year requirement due to qualifying circumstances.
Frequently Asked Questions
These questions address the most common sources of confusion about home sale capital gains, the Section 121 exclusion, and basis adjustments.
Conclusion
The Section 121 exclusion eliminates federal capital gains tax for most homeowners who sell their primary residence after meeting the 2-year ownership and use requirements. David and Ellen owe nothing on a $160,800 gain. Susan owes $11,580 on the $77,200 that exceeds her single exclusion — versus $49,080 without it. Mark owes nothing because his partial exclusion from a qualifying job relocation exceeds his $41,100 gain. Use the capital gains calculator above to run your own numbers before selling, and make sure your adjusted basis includes every improvement you have ever made to the property.
Frequently asked questions
What is the Section 121 exclusion?
Section 121 of the Internal Revenue Code allows homeowners to exclude up to $250,000 in capital gain (single filers) or $500,000 (married filing jointly) from the sale of a primary residence. To qualify, you must have owned and lived in the home as your primary residence for at least 2 of the 5 years immediately preceding the sale. The exclusion can be used repeatedly, but not more than once in any 2-year period.
How do I calculate my adjusted basis?
Adjusted basis starts with the purchase price, adds acquisition costs paid at closing (origination fees, title insurance, recording fees, transfer taxes paid by the buyer), adds all capital improvements made during ownership, and subtracts any depreciation previously claimed for business or rental use. A $350,000 purchase with $7,000 in closing costs and $45,000 in improvements has an adjusted basis of $402,000 — reducing taxable gain by $52,000 compared to using the purchase price alone.
What counts as a capital improvement versus a repair?
Capital improvements add value, extend useful life, or adapt the property to a new use — and they increase your adjusted basis. Examples include a new roof, an addition, a kitchen or bathroom remodel, a new HVAC system, a deck, and energy efficiency upgrades. Routine maintenance and repairs that simply keep the home in its current condition — painting, fixing a broken window, replacing a worn carpet patch — do not increase basis and are not capital improvements.
Do I owe capital gains tax if I sell my home?
Most primary residence sellers owe nothing in federal capital gains tax. If your gain is below $250,000 (single) or $500,000 (married) and you meet the 2-year ownership and use requirements, the entire gain is excluded. You still need to report the sale if you receive Form 1099-S from the title company; you simply report the exclusion on your return. If your gain exceeds the exclusion threshold, only the excess is taxable at long-term capital gains rates.
What happens if I sell before living in the home for 2 years?
You may still qualify for a partial exclusion if you are selling due to a job relocation to a new work location at least 50 miles farther from your old home, a health circumstance requiring the move, or another unforeseen event. The partial exclusion is proportional to your months of residence: (months lived in home / 24) x $250,000 (or $500,000 married). A 15-month residency with a qualifying job change yields a $156,250 partial exclusion for single filers.
How does a home office affect the capital gains calculation?
If you claimed depreciation on a home office, that portion of the home basis is reduced by the accumulated depreciation. When you sell, the depreciated portion cannot be fully excluded — the depreciation is subject to recapture tax at a maximum rate of 25% (unrecaptured Section 1250 gain), even if the rest of the gain is covered by the Section 121 exclusion. This is one reason some tax advisors caution against claiming home office deductions for homeowners who expect to sell at a significant gain.
Are real estate commissions and closing costs deductible from the gain?
Yes. Selling costs — real estate agent commissions, attorney fees, title search fees, transfer taxes paid by the seller, and similar expenses — reduce your net sale proceeds and therefore your realized gain. A $780,000 sale with $50,800 in selling costs produces $729,200 in net proceeds, reducing the taxable gain by $50,800.
What are long-term capital gains rates for home sales?
For sales of homes held more than 1 year, gains are taxed at long-term capital gains rates: 0% for taxpayers with taxable income below $47,025 (single) or $94,050 (married) in 2024, 15% for most middle-income earners, and 20% for high earners with taxable income above $518,900 (single) or $583,750 (married). Short-term capital gains (homes held 1 year or less) are taxed as ordinary income — a significantly higher rate for most sellers.
Does the exclusion apply to rental properties or vacation homes?
No. The Section 121 exclusion applies only to your primary residence. Rental properties and second homes do not qualify. However, if you convert a rental property to your primary residence and live in it for 2 of the 5 years before sale, you may qualify for a partial exclusion on the portion of gain attributable to the primary residence period. Gains attributable to the rental period (and all accumulated depreciation) remain taxable.
Do I need to report the home sale if my gain is fully excluded?
You are not required to report the sale on your tax return if the entire gain is excluded and you did not receive Form 1099-S from the settlement agent. If you did receive Form 1099-S, or if any portion of the gain is taxable, report the sale on Schedule D and Form 8949. It is generally advisable to report the exclusion on your return even when no tax is owed, to create a clear record if the IRS ever questions the sale.
About the author
ForYouToolkit Editorial Team
forYouToolkit Editorial Team — Personal Finance & Legal Calculators for U.S. Readers
Our editorial team researches and writes practical guides on financial calculators, tax tools, and legal estimators designed for U.S. readers. Content is reviewed for accuracy against current U.S. regulations and verified against calculator outputs before publication.
Disclaimer
This content is for informational purposes only and does not constitute financial, legal, or tax advice. Calculator results are estimates based on the inputs provided and may not reflect your individual circumstances. Always consult a qualified financial advisor, tax professional, or attorney before making financial decisions.