Capital Gains Tax on Home Sale and Why Many Sellers Owe Nothing
9 min read

The short answer
If you owned and lived in the home for two of the five years before the sale, the IRS lets you exclude up to $250,000 of gain, or $500,000 on a joint return (IRS Publication 523, 2024). Only the gain above that limit is taxed, and gain is your sale price minus selling costs minus your adjusted basis. Your mortgage balance and the size of your closing check have nothing to do with the tax.
Say you bought your house in 1996 for $185,000 and it would sell today for around $600,000. On paper that looks like a $415,000 tax problem. For many sellers it turns out to be no problem at all, because the IRS taxes gain, and gain is a different number from the check you walk away with at closing.
Every line of that calculation starts with a figure you can pin down today, which is the price your house is likely to sell for. A free Kelley Blue Book Homes valuation report gives you that number in minutes, so you can run the math below before you list.
We'll walk through the rules in plain English, from how the exclusion works and who qualifies to what changes in a divorce, an estate, or a second home sale. None of it is tax advice, so confirm your own numbers with a tax professional before you file.
What Is Capital Gains Tax on a Home Sale?
When you sell your home for more than you have invested in it, the difference is a capital gain, and the IRS counts it as taxable income unless a specific rule says otherwise. For a primary residence, a rule does say otherwise. Capital gains tax on a home sale is measured against your adjusted cost basis, which means the purchase price plus the costs of buying plus the improvements you made over the years. Your mortgage balance has nothing to do with it, and neither does the size of the check you take home at closing.
How Much Gain Can You Exclude?
The IRS lets you exclude up to $250,000 of gain if you file single and up to $500,000 if you are married filing jointly, according to IRS Publication 523, 2024. That exclusion is the reason so many long-time homeowners sell without owing a dime of federal tax.
Let's apply those limits to the house above. You bought in 1996 for $185,000, put $70,000 into a kitchen, two bathrooms and a roof, then sell today for $600,000 with $42,000 in commissions and closing costs. That gives you an adjusted basis of $255,000, an amount realized of $558,000, and a gain of $303,000. A married couple filing jointly owes zero federal capital gains tax on that sale. A single filer with the same numbers would see roughly $53,000 of it become taxable.
Do You Qualify for the Exclusion?
The IRS applies three tests, all described in Publication 523, 2024, and you need to pass every one of them.
- The ownership test asks whether you owned the home for at least two years during the five years before the sale date.
- The use test asks whether you lived in it as your main home for at least two years during that same window, and the 24 months don't have to run back to back.
- The look-back test checks that you did not exclude gain from another home sale in the two years before this one.
Joint filers get the full $500,000 when either spouse meets the ownership test and both meet the use test. If you have to sell early because of a work relocation, a health condition, or certain unforeseeable events, the IRS allows a prorated share of the exclusion based on the months you did qualify. A move you simply chose to make may or may not meet that test, so ask a tax professional before you count on it.
How to Calculate Your Gain
The math runs in three steps, and the order matters.
- Find your amount realized. Take the sale price and subtract your selling expenses. Commissions, title fees, transfer taxes and legal fees all come out here (IRS Publication 523, 2024).
- Find your adjusted basis. Start with the purchase price, add the settlement costs you paid when you bought, add qualifying improvements, and subtract any depreciation you claimed for business or rental use.
- Subtract, then apply the exclusion. Amount realized minus adjusted basis equals your gain, and the exclusion comes off that figure.
Keep in mind that a loss on a personal residence is not deductible, as IRS Topic No. 701, 2025 explains, so don't plan on a write-off if the sale comes in under your basis. Any estimate of capital gains tax on a home sale starts with a realistic sale price in step one, and a free Kelley Blue Book Homes valuation report gives you one in minutes.
What Counts Toward Your Cost Basis?
Capital improvements add to your basis and shrink your taxable gain dollar for dollar, while repairs and routine maintenance stay out of the calculation entirely. Qualifying examples from IRS Publication 523, 2024 include additions and finished basements, roofing, siding and windows, kitchen and bath remodels, HVAC and plumbing systems, and permanent landscaping, driveways and fences. Thirty years of that kind of work can add a substantial amount to your basis, which is why it pays to dig out the invoices and permits before closing. Once you have them, keep them with your other important papers, somewhere your spouse or family can find them.
What Tax Rate Applies Above the Exclusion?
Under IRS Topic No. 409, 2025, gain above the exclusion on a home you owned for more than a year is long term, which means it is taxed at 0%, 15% or 20% depending on your taxable income and filing status. A separate 3.8% net investment income tax can also apply to the taxable portion for higher-income filers, and IRS Topic No. 559, 2025 covers who falls into that group.
Your state can change the picture. California allows the same $250,000 and $500,000 exclusion and taxes any gain above it as regular income, with no lower rate for capital gains, according to the California Franchise Tax Board, 2025. Nevada has no state income tax, so there is no state tax on the gain at all, according to the Nevada Department of Taxation, 2025. Other states land somewhere between those two, so check yours with a tax professional.
Sellers over 55 get no special break, even though plenty of people still remember one. The Taxpayer Relief Act of 1997 replaced the one-time age-55 exclusion with the current ownership and use rules, which are generally more generous (IRS Publication 523, 2024).
When You Have to Report the Sale
You need to report the sale if you have gain you cannot fully exclude, if you received a Form 1099-S from the closing agent, or if you choose not to claim the exclusion (IRS Publication 523, 2024). A 1099-S in your mailbox means the sale goes on your return even when every dollar of the gain is excluded. Under IRS Topic No. 701, 2025, taxable gain is reported on Schedule D and Form 8949. Hold on to your purchase paperwork, improvement records and closing statements until the period of limitations expires for the year of the sale, which IRS Topic No. 305, 2025 explains in more detail.
Divorce, Inherited Homes, and Second Homes
Divorce
Transfers of a home between spouses as part of a divorce are generally not taxable events, and the spouse who keeps the house takes over the existing basis (IRS Publication 504, 2024). The gain travels with the house and gets settled at the eventual sale.
Settling an Estate
Inherited property generally gets a basis equal to its fair market value on the date of death, which often erases decades of appreciation for the heirs (IRS Publication 559, 2024). A surviving spouse who sells within two years of a spouse's death may still claim the full $500,000 exclusion when the other conditions are met (IRS Publication 523, 2024).
Second Homes and Rentals
The exclusion covers a main home only. Depreciation you claimed on a rental is recaptured at up to 25% when you sell, and IRS Topic No. 701, 2025 spells out how that works. Each of these situations deserves a conversation with a tax professional or an estate attorney before you sign anything.
How Kelley Blue Book Homes can help
Every calculation above starts from one number you can pin down today, which is what your house is likely to sell for. That price sets your amount realized, and your amount realized drives your whole estimate of capital gains tax on a home sale.
The Kelley Blue Book Homes valuation report is free, ready in minutes, and comes with no obligation. It is the closest thing to an appraisal without ordering one. It accounts for condition, upgrades, layout and remodels, uses real comps from your neighborhood with every adjustment explained, and is designed to land within 3% of the final sale price. It is not a lender appraisal and cannot be used for mortgage or lending transactions. A vetted local agent can use the same information to help you choose a pricing and selling strategy. More than 500,000 homes and more than $275 billion in property have been valued so far.
Enter your address and get your free report, then take the numbers to your tax professional.
Key Points to Remember
- The IRS lets you exclude up to $250,000 of gain from a home sale, or $500,000 filing jointly, if you owned and lived in the home two of the last five years (IRS Publication 523, 2024).
- Gain is sale price minus selling costs minus adjusted basis, and your mortgage balance plays no part in the calculation.
- Capital improvements like roofs, remodels and additions raise your basis and cut your taxable gain (IRS Publication 523, 2024).
- Under IRS Topic No. 409, 2025, gain above the exclusion on property held over a year is taxed at 0%, 15% or 20%.
- The old age-55 one-time exclusion ended in 1997, and the current ownership and use rules replaced it (IRS Publication 523, 2024).
Frequently asked questions
Do I pay capital gains tax if I sell my house after 20 years?
Usually not, because how long you have owned the home doesn't trigger the tax on its own. What matters is whether you owned and lived in it for two of the five years before the sale, which lets you exclude up to $250,000 of gain, or $500,000 on a joint return, under IRS Publication 523, 2024. Anything above that limit is taxed.
Is there a capital gains tax exemption for homeowners over 55?
No. The one-time exclusion for sellers age 55 and older was eliminated by the Taxpayer Relief Act of 1997 and replaced with the current ownership and use test, which has no age requirement (IRS Publication 523, 2024). You can use the current rules once every two years, and for most sellers they are more favorable than the old break was.
Does buying another house avoid capital gains tax on a home sale?
No. The old rollover rule that let sellers defer gain by purchasing a more expensive home was repealed in 1997. Today the ownership and use exclusion applies whether or not you buy again, according to IRS Publication 523, 2024, and what you do with the proceeds has no effect on the tax.
What home improvements reduce capital gains tax?
Capital improvements that add value, prolong the home's life or adapt it to new uses raise your cost basis, and a higher basis means a smaller taxable gain. IRS Publication 523, 2024 lists additions, new roofs, remodeled kitchens and baths, HVAC systems, new windows and permanent landscaping among the examples. Ordinary repairs and maintenance don't count.
How do I know what my home will sell for so I can estimate my gain?
Start with a valuation built on real neighborhood comps and your home's actual condition. The free Kelley Blue Book Homes valuation report is ready in minutes, accounts for condition, upgrades and remodels, and is designed to land within 3% of the final sale price. It is not a lender appraisal, so treat it as a planning number and take it to your tax professional.
Do I have to report a home sale if I owe no tax?
Yes, in some cases you do. You must report the sale if you received a Form 1099-S from the closing agent, if any part of the gain can't be excluded, or if you decide not to claim the exclusion (IRS Publication 523, 2024). Confirm your reporting obligation with a tax professional before filing season.
