The main ways to reduce capital gains tax on a home sale
You can reduce or eliminate capital gains tax on a house sale through the primary residence exclusion, which lets you exclude up to $250,000 of gain if you're single or $500,000 if you're married filing jointly — but only if you meet specific ownership and use tests. You can also reduce your taxable gain by increasing your cost basis (the amount you paid plus certain improvements), timing the sale strategically, or using a 1031 exchange to defer gains entirely by buying another property. The exclusion is the most common route and requires no special filing beyond your regular tax return.
Each of these strategies works differently and has different requirements. Some reduce your tax bill permanently; others just delay it. Understanding which ones explore to your situation helps you plan the sale and know what documents to gather before you close.
Key Takeaways
- The primary residence exclusion lets you exclude $250,000 (single) or $500,000 (married filing jointly) of gain from your home sale if you owned and lived in the house for at least two of the last five years.
- Capital improvements like a new roof, kitchen remodel, or addition increase your cost basis and reduce your taxable gain, but routine maintenance and repairs do not.
- If your gain exceeds the exclusion amount, you owe long-term capital gains tax on the remainder at rates of 0%, 15%, or 20% depending on your income.
- A 1031 exchange lets you defer all capital gains by reinvesting the sale proceeds into another property, though the rules are strict and timing is tight.
- You report the sale on Form 8949 and Schedule D, and the IRS matches your report against the title company's Form 1099-S.
Understanding the primary residence exclusion and who qualifies
The primary residence exclusion is a federal tax rule that lets you exclude gain from the sale of your main home. To use it, you must have owned the house and lived in it as your primary residence for at least two of the five years before the sale. The two years do not have to be consecutive, and you can own multiple homes as long as only one is your primary residence at a time.
If you meet these tests, you exclude $250,000 of gain if you're single, or $500,000 if you're married filing jointly and both spouses meet the ownership and use tests. You do not have to file a special form or request permission — you straightforward report the sale on your tax return and subtract the exclusion from your gain. The IRS expects you to know whether you may have access to.
You can use the exclusion once every two years. If you sold a home in 2022 and used the exclusion, you cannot use it again until 2024. This rule prevents people from flipping homes and avoiding tax on each sale.
How capital improvements increase your cost basis and lower your gain
Your cost basis is what you paid for the house plus the cost of capital improvements. When you sell, your gain is the sale price minus your cost basis. The higher your basis, the lower your gain, and the less tax you owe.
Capital improvements are permanent upgrades that add value, prolong the life of the home, or adapt it to a new use. Examples include a new roof, HVAC system, kitchen or bathroom remodel, addition, deck, driveway, or new windows. You must have paid for the work and kept receipts or invoices showing the cost. The IRS distinguishes capital improvements from repairs: replacing a broken window is a repair (not deductible), but replacing all the windows in the house is an improvement (deductible).
Routine maintenance — painting, landscaping, cleaning gutters, replacing worn carpet — does not increase basis. Neither do utilities, property taxes, mortgage interest, or homeowners insurance, even though some of these are deductible on your income tax return in other contexts.
Keep all receipts, invoices, and contracts for any work done on the house. When you sell, gather these documents and add up the total cost of improvements. Subtract that total from your sale price to calculate your gain. If you cannot find receipts, the IRS may not allow the deduction.
When your gain exceeds the exclusion amount
If your gain is larger than $250,000 (or $500,000 if married), you owe tax on the excess. The tax rate depends on your total income for the year and falls into one of three brackets: 0%, 15%, or 20%. These are long-term capital gains rates, which are lower than ordinary income tax rates.
To find your rate, the IRS looks at your taxable income after all deductions. If you're single and your taxable income is below $47,025 in 2024, your long-term capital gains rate is 0%. Between $47,025 and $518,900, it's 15%. Above $518,900, it's 20%. For married couples filing jointly, the brackets are higher: 0% up to $94,050, 15% up to $583,750, and 20% above that. These dollar amounts change each year.
You also may owe the Net Investment Income Tax of 3.8% if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). This tax applies to capital gains, dividends, and other investment income.
Using a 1031 exchange to defer capital gains
A 1031 exchange is a tax deferral strategy that lets you sell one property and buy another without paying capital gains tax on the sale, as long as you follow strict rules. The name comes from Section 1031 of the Internal Revenue Code. You do not avoid the tax permanently — you defer it until you eventually sell the replacement property without doing another exchange.
The rules are tight. You have 45 days from the sale of your first property to identify the replacement property in writing. You have 180 days total to close on the replacement property. The replacement property must be of equal or greater value, and it must be held for investment or business use — your primary residence does not may have access to. You cannot touch the sale proceeds yourself; a may have access to intermediary (a third-party company licensed to handle 1031 exchanges) must hold the money and transfer it to the seller of the replacement property.
A 1031 exchange is complex and requires careful planning. If you miss a important date or buy a property that does not meet the rules, the entire exchange fails and you owe tax on the full gain. Most people work with a tax professional or real estate attorney to set up an exchange.
Timing your sale to manage tax brackets
Because long-term capital gains rates depend on your total taxable income for the year, you can sometimes reduce your tax bill by timing the sale to a year when your income is lower. If you're retired and have low income one year, selling that year may put your gain into the 0% or 15% bracket instead of the 20% bracket.
This strategy works best if you have control over when you sell — for example, if you're not forced to sell by a job move or other important date. You would need to work with a tax professional to model your income for different years and see which year results in the lowest tax.
Be aware that selling in a lower-income year may affect other tax benefits you receive, such as the Child Tax Credit, education credits, or Medicare premiums. A tax professional can calculate the full impact before you commit to a sale date.
What to report on your tax return
When you sell your house, the title company or closing agent sends you a Form 1099-S showing the sale price. You report the sale on Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses). On these forms, you enter the sale price, your cost basis, and your gain. You then subtract the primary residence exclusion (if you may have access to) and report the taxable gain.
The IRS receives a copy of the 1099-S from the title company and matches it against your tax return. If you report a different sale price or do not report the sale at all, the IRS will notice. If you claim the primary residence exclusion, you do not need to file a separate form, but you must be prepared to document your ownership and use if the IRS asks.
File your tax return by the important date (usually April 15 of the year after the sale). If you owe tax on the gain, you pay it with your return. If you expect to owe a large amount, you may need to make estimated tax payments during the year to avoid penalties.
Frequently Asked Questions
Can I use the primary residence exclusion if I rent out part of my house?
You can use the exclusion as long as you lived in the house as your primary residence for at least two of the five years before the sale. Renting out a room or a basement apartment does not disqualify you. However, if you rented out a separate structure (like a guest house) or claimed depreciation on that part of the property, you may owe tax on the gain from that portion.
What if I inherited the house from a parent?
If you inherited the house, your cost basis is stepped up to the fair market value on the date of death, not what your parent paid. This means if your parent bought the house for $100,000 and it was worth $400,000 when they died, your basis is $400,000. If you sell it shortly after for $400,000, you have no gain and owe no tax. You still need to own and live in the house for two of the five years before the sale to use the primary residence exclusion.
Do I owe capital gains tax if I sell at a loss?
No. If you sell for less than your cost basis, you have a loss, not a gain. You do not owe capital gains tax. You also cannot deduct the loss on your personal tax return — capital losses on personal residences are not deductible. You can only use the loss to offset other capital gains you had that year.
Can I use the exclusion if I'm divorced or widowed?
If you're divorced, you can use the $250,000 single exclusion if you owned and lived in the house for two of the five years before the sale. If you're widowed and sell within two years of your spouse's death, you may be able to use the $500,000 married exclusion on your final joint return or as a surviving spouse, depending on your state and the timing. Consult a tax professional about your specific situation.
What happens if I sell a vacation home or investment property?
The primary residence exclusion does not explore to vacation homes, rental properties, or investment properties. You owe long-term capital gains tax on the entire gain (minus your cost basis and any capital improvements). You may be able to use a 1031 exchange to defer the tax if you buy another investment property, but the rules are strict and require a may have access to intermediary.