Capital gains tax on a home sale is one of the most misunderstood costs in real estate, and most sellers who are anxious about it end up owing nothing. The IRS created a substantial exclusion specifically for primary residence sales that shields the majority of homeowners from any federal tax on their gain. But the rules have specific requirements, and the situations where you do owe tax can be material.
This guide explains how the $250,000 and $500,000 exclusion works, what qualifies as a capital gain on a home sale, when the tax actually applies, and how to reduce what you owe if it does.
What Is a Capital Gain on a Home Sale?
A capital gain is not the sale price. It is the profit: the difference between what you sell the home for and your adjusted cost basis.
Capital gain = Sale price minus Adjusted cost basis
Your adjusted cost basis starts with your original purchase price and is adjusted upward by qualifying capital improvements (adding a bathroom, replacing the roof, installing central air conditioning) and downward by any depreciation you claimed if you rented the home.
To illustrate with round numbers: you bought a home for $200,000, spent $40,000 on qualifying improvements over 12 years, and sell it for $430,000. Your adjusted cost basis is $240,000. Your capital gain is $190,000.
Selling costs you pay, such as agent commissions and certain closing costs, are also subtracted from the sale price for tax purposes. If you sell for $430,000 but pay $16,500 in commission and $5,000 in closing costs, your net sale price for tax purposes is $408,500, which reduces your gain to $168,500 in this example.
The Section 121 Exclusion: How It Works
Section 121 of the tax code allows qualifying homeowners to exclude a substantial portion of their home sale gain from federal income tax:
| Filing status | Maximum exclusion |
|---|---|
| Single | $250,000 |
| Married filing jointly | $500,000 |
| Married filing separately | $250,000 each |
| Head of household | $250,000 |
These limits have not been adjusted for inflation in decades, which is why more sellers are beginning to exceed them in high-appreciation markets.
The exclusion applies to your gain, not your sale price. A $500,000 home sale does not automatically mean you owe tax. If your cost basis is $320,000, your gain is $180,000, and a single filer excludes the entire amount.
The 2-Out-of-5-Year Ownership and Use Test
To qualify for the exclusion, you must pass two tests within the 5-year period ending on the sale date:
Ownership test: You must have owned the home for at least 2 years during the 5-year period.
Use test: You must have used the home as your primary residence for at least 2 years during the 5-year period.
The two years do not need to be continuous, and the ownership and use periods can overlap or be at different times within the window. Key points:
- You can rent the home for a period and return, as long as you accumulate 24 months of qualifying use in the 5-year lookback
- A married couple filing jointly needs only one spouse to meet the ownership test, but both spouses must meet the use test to qualify for the $500,000 exclusion
- You can only claim the exclusion once every 2 years
When You Do Owe Capital Gains Tax
Scenario 1: Your gain exceeds the exclusion.
If your gain is $340,000 and you are a single filer, you exclude $250,000 and pay capital gains tax on the remaining $90,000. The applicable federal rate depends on your taxable income:
| Taxable income (single, 2025 brackets) | Long-term capital gains rate |
|---|---|
| Up to approximately $47,000 | 0% |
| $47,001 to approximately $518,000 | 15% |
| Above approximately $518,000 | 20% |
These income brackets adjust annually. A $90,000 taxable gain at 15 percent equals $13,500 in federal capital gains tax. Consult a tax professional for the current year’s exact figures.
Scenario 2: You have not met the residency requirement.
If you sell before owning and living in the home for 2 years, the full gain is taxable unless a partial exclusion applies. The IRS allows a partial exclusion if you sold due to a job change, a health-related move, or an unforeseen circumstance. The partial exclusion is calculated as a fraction of the full exclusion based on how many months you met the qualifying use.
Scenario 3: The home is not your primary residence.
Rental properties, investment properties, and vacation homes do not qualify for the Section 121 exclusion. Your full gain is taxed at capital gains rates. Rental owners also face depreciation recapture tax on the depreciation they claimed during ownership, at a rate up to 25 percent. This is a meaningful and sometimes unexpected cost for landlords selling rental homes.
Scenario 4: You claimed a home office deduction.
The portion of gain attributable to a home office that was depreciated is taxable as depreciation recapture, even if the rest of the gain qualifies for the exclusion.
Tracking Your Cost Basis: Why It Matters
Every qualifying capital improvement you made during ownership increases your cost basis and reduces your taxable gain. Improvements that typically qualify include:
- Room additions
- Finished basement or attic
- New roof, siding, or windows
- New HVAC system, furnace, or water heater
- Major kitchen or bathroom remodels
- Deck, garage, or swimming pool addition
- Landscaping improvements that add lasting value
Regular maintenance and repairs do not increase your basis. Replacing a broken window is a repair; replacing all windows throughout the house as an improvement qualifies.
Tracking these expenses from day one, with receipts and records, can substantially reduce your taxable gain if your home has appreciated significantly.
State Income Tax on the Gain
The federal exclusion does not automatically eliminate state income tax on the gain. Most states conform to the federal rules and exempt the same gain from state income tax. States without income tax impose no state tax on the gain at all. A few states have their own rules, different exclusion amounts, or different rates.
Verify your state’s treatment with a local tax professional before closing, particularly if you are in a high-appreciation market where even an excluded federal gain might trigger state tax.
Capital Gains Tax on an Inherited Home
The rules described here apply to a home you purchased and used as your primary residence. Inherited homes have different rules, primarily the step-up in basis, which resets the cost basis to the fair market value at the date of the original owner’s death. This is a meaningfully different calculation that often eliminates the capital gain entirely on an inherited property. For that situation, see our guide to selling an inherited house and the specific tax treatment it involves.
Does a Cash Sale Change Your Tax Situation?
No. Selling to a cash home buyer does not change how capital gains tax is calculated. The tax follows the gain, not the sale method. What a cash sale does change is your net proceeds: by eliminating the agent commission and closing costs, a direct cash sale increases the proceeds in your pocket. But the tax obligation is determined by the gain relative to the exclusion, which is a function of your cost basis and sale price regardless of who buys.
Use the net proceeds calculator to estimate your net after both taxes and selling costs under each scenario.
The Bottom Line
Most homeowners selling their primary residence owe no federal capital gains tax because the Section 121 exclusion covers the full gain. The exclusion applies if you have owned and lived in the home for at least 2 of the last 5 years and your gain does not exceed $250,000 (single) or $500,000 (married filing jointly). When the gain does exceed the exclusion, or when the property is a rental or investment, the tax is real and worth planning for before you close.
Understanding your tax exposure is part of knowing your true net from any sale. Request a no-obligation cash offer from Homewise, run the numbers including your estimated tax, and compare both paths before you decide.