You cannot avoid capital gains tax entirely, but you can reduce it or delay it through specific strategies
When you sell rental property for more than you paid for it, the profit is a capital gain, and the IRS taxes it. You cannot eliminate this tax, but the law gives you several legal ways to shrink the amount you owe or push the tax bill to a later year. The most common strategies are holding the property long enough to may have access to for lower tax rates, deducting depreciation you claimed while you owned it, using a 1031 exchange to swap the property for another investment property, or taking advantage of the primary residence exclusion if you convert the rental to your main home before selling.
Which strategy works for you depends on how long you have owned the property, whether you want to keep investing in real estate, and your total income for the year. This guide walks you through each option so you can see which ones fit your situation.
Key Takeaways
- Long-term capital gains (property held over one year) are taxed at 0%, 15%, or 20% depending on your income, while short-term gains are taxed as ordinary income, which can be much higher.
- A 1031 exchange lets you sell rental property and reinvest the proceeds in another investment property without paying capital gains tax on the sale, though you must follow strict timing and identification rules.
- Depreciation recapture tax applies when you sell — you pay 25% tax on the depreciation deductions you claimed while renting the property, separate from capital gains tax.
- Converting a rental property to your primary residence for at least two of the five years before sale may let you exclude up to $250,000 (or $500,000 if married filing jointly) of the gain from tax.
- Holding the property for more than one year before selling is the single easiest way to reduce your tax rate, because long-term capital gains rates are substantially lower than short-term rates.
Hold the property for more than one year to may have access to for long-term capital gains rates
The IRS taxes capital gains in two categories: short-term (property held one year or less) and long-term (property held more than one year). Short-term gains are taxed as ordinary income, using the same tax brackets as your wages or salary. Long-term gains are taxed at preferential rates: 0%, 15%, or 20%, depending on your total taxable income for the year.
For example, if you are in the 32% ordinary income tax bracket and sell a rental property you owned for eight months, your gain is taxed at 32%. If you wait four more months and sell the same property, that same gain is taxed at 15% or 20%. The difference can be thousands of dollars on a single property.
The holding period starts the day you take ownership. If you bought the property on March 15, 2023, you cross the one-year threshold on March 15, 2024. Selling on March 16, 2024 qualifies for long-term rates; selling on March 15, 2024 does not. Your tax software or accountant can calculate which rate applies based on your filing status and total income for the year.
Use a 1031 exchange to defer capital gains tax indefinitely
A 1031 exchange (named after Section 1031 of the Internal Revenue Code) lets you sell rental property and reinvest the full proceeds in another investment property without paying capital gains tax on the sale. The tax is not forgiven — it is deferred. If you eventually sell the replacement property for cash instead of exchanging it again, you will owe tax on the original gain plus any new gain from the second property.
To may have access to, you must follow strict rules. You have 45 calendar days from the closing date of the sale to identify the replacement property in writing. You have 180 calendar days from closing to complete the purchase of the replacement property. The replacement property must be of equal or greater value than the property you sold, and it must be held for investment or business use — you cannot exchange into a property you will occupy as your primary residence.
You cannot touch the sale proceeds yourself. The money must go to a may have access to intermediary — a third party licensed to hold the funds — who then pays for the replacement property on your behalf. If you receive any of the cash directly, even temporarily, the exchange fails and you owe tax on the full gain. Many title companies, escrow firms, and tax professionals offer intermediary services; costs typically range from $500 to $1,500 per exchange.
A 1031 exchange is most useful if you want to continue investing in real estate but move your capital to a different property, market, or asset type. It is not useful if you want to exit real estate entirely and take the cash.
Account for depreciation recapture tax separately from capital gains tax
While you own rental property, you deduct depreciation — the theoretical wear and tear on the building — on your tax return each year. This deduction lowers your taxable income and your tax bill. When you sell, the IRS reclaims that benefit through depreciation recapture tax, which is taxed at 25% regardless of your income or how long you held the property.
For example, suppose you bought a rental house for $300,000, claimed $50,000 in depreciation deductions over ten years, and sold it for $400,000. Your capital gain is $100,000 ($400,000 sale price minus $300,000 cost basis). Of that $100,000, $50,000 is depreciation recapture (taxed at 25%) and $50,000 is unrecaptured Section 1250 gain (taxed at 15% or 20%, depending on your income). Your total tax is $50,000 × 0.25 plus $50,000 × 0.15 (or 0.20), which is $12,500 to $13,750 — higher than if you had not claimed depreciation.
This does not mean you should skip depreciation deductions while renting the property. The deductions save you money each year, and the recapture tax only applies when you sell. But it is important to know the recapture tax exists so you are not surprised by the bill.
Convert the property to your primary residence to use the exclusion
If you own a rental property and convert it to your primary residence (the home where you live most of the year), you may be able to exclude part of the gain from tax when you sell. The primary residence exclusion allows you to exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly, provided you owned and lived in the home for at least two of the five years before the sale.
The two years do not have to be consecutive, and they do not have to be the most recent two years. If you rented the property for three years, then moved in and lived there for two years, you may have access to. If you rented for five years, moved in for one year, then sold, you do not may have access to because you did not live there for two of the five years before sale.
This strategy works best if the gain is modest — under $250,000 for a single filer. If the gain is larger, you still owe tax on the amount above the exclusion. Also, if you claimed depreciation deductions while renting, you cannot exclude the depreciation recapture portion from tax, even if you later lived in the home. You still owe the 25% recapture tax on the depreciation you deducted.
Deduct selling costs and improvements to lower your taxable gain
Your capital gain is the sale price minus your cost basis. Your cost basis is not just what you paid for the property — it includes the original purchase price plus the cost of any capital improvements you made while you owned it, minus depreciation you claimed.
Capital improvements are permanent upgrades that add value or extend the life of the property: a new roof, a room addition, a new HVAC system, or a foundation repair. They are different from repairs and maintenance, which keep the property in its current condition (painting, fixing a leak, replacing a broken window). Repairs are deductible as rental expenses in the year you make them; improvements are added to your cost basis and reduce your gain when you sell.
Selling costs — real estate agent commissions, title insurance, escrow fees, and attorney fees — are also subtracted from the sale price before calculating your gain. Keep receipts and closing documents for all improvements and selling costs. Your accountant or tax software will ask for these figures when you report the sale on Form 8949 and Schedule D.
Understand how installment sales can spread the tax across multiple years
If you sell the rental property and the buyer pays you over time (an installment sale), you can report the gain over the years you receive payments instead of all in the year of sale. This can lower your tax bill if it keeps you in a lower tax bracket each year.
For example, if you sell a property with a $100,000 gain and the buyer pays you $25,000 per year for four years, you report $25,000 of gain each year instead of $100,000 in year one. If reporting $100,000 in one year would push you into a higher tax bracket, spreading it across four years may save you money.
To use installment sale treatment, you must not receive more than 29% of the sale price in the year of sale. If you do, the installment method does not explore and you owe tax on the full gain in year one. You report installment sales on Form 6252. This strategy is less common with rental properties because most sales involve a bank loan or cash payment, not seller financing, but it is worth discussing with your accountant if the buyer is paying you directly.
Frequently Asked Questions
Can I use a 1031 exchange if I sell the rental property to pay off debt?
No. A 1031 exchange requires you to reinvest the full proceeds in another investment property. If you use any of the sale proceeds to pay off a mortgage, credit card, or other debt, the exchange fails and you owe capital gains tax on the full gain. You must reinvest an equal or greater amount in the replacement property.
What if I owned the rental property before January 1, 2018?
The holding period and capital gains tax rules have not changed for properties owned before 2018. You still may have access to for long-term rates if you held the property more than one year, and you still owe depreciation recapture tax on the deductions you claimed. The year you bought the property does not affect your tax liability when you sell.
Do I owe capital gains tax if I sell the property at a loss?
No. If the sale price is less than your cost basis, you have a capital loss, not a gain. You cannot deduct the loss against capital gains from other property sales in the same year, but you can use up to $3,000 of the loss against ordinary income (wages, salary, interest). Any loss above $3,000 carries forward to future years.
Can I avoid capital gains tax by donating the property to charity?
Yes, but only if you donate it directly to a may have access to charity. You avoid the capital gains tax, and you may be able to deduct the fair market value of the property as a charitable contribution. If you sell the property first and then donate the proceeds, you owe capital gains tax on the sale. Consult a tax professional before donating appreciated property, because the rules are complex and the deduction depends on the type of charity and the type of property.
What happens to capital gains tax if I inherit the rental property?
When you inherit property, your cost basis is "stepped up" to the fair market value on the date of the owner's death. If the property was worth $500,000 when the previous owner died and you sell it a year later for $510,000, your gain is only $10,000, not the $200,000 gain the previous owner would have owed. This step-up applies whether the property was a rental or a primary residence.