You cannot avoid taxes on rental property sales, but you can reduce what you owe
When you sell a rental property, the IRS taxes the profit you made—the difference between what you paid for it and what you sold it for. There is no legal way to pay zero tax on that gain. What you can do is lower the taxable profit itself by documenting deductions, understanding which gains may have access to for lower tax rates, and timing the sale strategically. The difference between doing this right and doing it wrong can be thousands of dollars.
The core principle is this: your taxable gain equals the sale price minus your adjusted cost basis. Your cost basis is not just what you paid for the property—it includes improvements you made, and it is reduced by depreciation you claimed on your tax returns over the years you owned it. The lower your adjusted basis, the higher your taxable gain. Most rental property owners can reduce their tax bill by carefully tracking improvements, understanding depreciation recapture, and knowing when a 1031 exchange makes sense.
Key Takeaways
- Your taxable gain is the sale price minus your adjusted cost basis, which includes the original purchase price plus capital improvements minus depreciation you already claimed.
- Capital improvements—new roof, HVAC system, foundation work—are added to your basis and reduce taxable gain, while repairs and maintenance are not.
- Depreciation recapture tax (25 percent federal) applies to the depreciation you claimed, separate from long-term capital gains tax on the remaining profit.
- A 1031 exchange lets you defer all taxes by reinvesting the sale proceeds into another rental property of equal or greater value within strict timelines.
- Selling at a loss, timing the sale across tax years, and working with a tax professional before you list can save significantly more than trying to reduce taxes after the sale closes.
The difference between improvements and repairs—and why it matters
The IRS distinguishes between capital improvements and repairs. A capital improvement adds value to the property, prolongs its life, or adapts it to a new use. A repair keeps the property in good condition. Only improvements are added to your cost basis; repairs are deducted in the year you pay for them and do not reduce your gain when you sell.
Examples of capital improvements: replacing the entire roof, installing a new HVAC system, adding a deck, upgrading the foundation, replacing all windows, adding insulation, or installing new plumbing or electrical systems. Examples of repairs: patching a roof, fixing a furnace, repainting, replacing broken windows, or fixing a leak. The line is not always clear. If you replace one shingle, that is a repair. If you replace the entire roof, that is an improvement. If you replace half the roof as part of a larger project, the IRS may view it as an improvement.
Keep receipts and invoices for every expense. When you sell, provide your tax professional with a list of all improvements you made, with dates and amounts. If you did not track improvements during ownership, you can still reconstruct them from credit card statements, bank records, and contractor invoices, but it is much harder. The more improvements you can document, the higher your adjusted basis and the lower your taxable gain.
How depreciation recapture works and what it costs
Every year you owned the rental property, you likely claimed depreciation—a deduction that assumes the building loses value over time. The IRS lets you deduct a portion of the building's cost (not the land) each year. When you sell, the IRS taxes that depreciation back at a rate of 25 percent, separate from the capital gains tax on the remaining profit. This is called depreciation recapture.
Here is a concrete example: you bought a rental house for $300,000 (building value $250,000, land $50,000). Over 20 years, you claimed $150,000 in total depreciation. You sell for $500,000. Your adjusted basis is $300,000 minus $150,000 = $150,000. Your total gain is $500,000 minus $150,000 = $350,000. Of that $350,000, the $150,000 in depreciation you claimed is taxed at 25 percent (federal, before state taxes) = $37,500. The remaining $200,000 is taxed as a long-term capital gain, which is 15 or 20 percent depending on your income level.
You cannot avoid depreciation recapture tax, but you can defer it. A 1031 exchange (explained below) defers both the capital gains tax and the recapture tax. If you do not do a 1031 exchange, plan for the 25 percent recapture tax on top of your capital gains tax and state income tax.
Using a 1031 exchange to defer all taxes on the sale
A 1031 exchange is a transaction structure that lets you sell one rental property and buy another without paying federal income tax on the gain—you defer the tax indefinitely, or until you eventually sell without doing another exchange. The property you sell and the property you buy must both be held for investment or business use (rental properties may have access to). Your primary residence does not.
The rules are strict. 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 close on the replacement property. The replacement property must be of equal or greater value. If you sell for $500,000, you must reinvest at least $500,000. If you pocket any cash, that cash is taxed as gain. You must use a may have access to intermediary—a third party that holds the sale proceeds and transfers them to the seller of the replacement property. You cannot touch the money yourself.
A 1031 exchange is complex and the timelines are unforgiving. If you miss the 45-day identification important date or the 180-day closing important date by even one day, the entire exchange fails and you owe tax on the full gain. Work with a tax professional and a may have access to intermediary before you list the property. The cost of setting up an exchange (usually $500 to $1,500) is worth it if you are selling a property with a large gain and plan to reinvest in another rental.
Long-term capital gains rates and how your income affects your tax bill
If you owned the rental property for more than one year before selling, the profit is taxed as a long-term capital gain. The federal tax rate depends on your total taxable income for the year. For 2024, the rates are 0 percent, 15 percent, or 20 percent. Higher earners pay 20 percent; lower earners may pay 15 percent or even 0 percent. These rates are lower than ordinary income tax rates, which is why long-term gains are preferable to short-term gains.
If you owned the property for one year or less, the gain is taxed as ordinary income at your marginal tax rate, which is typically higher. This is another reason to hold rental properties for at least two years before selling.
Your state may also tax capital gains. Some states have no capital gains tax; others tax it as ordinary income; a few have a separate capital gains tax. Check your state's rules before you sell. If you live in a high-tax state and are considering moving, timing the sale before or after a move can affect your tax bill significantly.
Timing the sale to spread gains across two tax years
If you sell late in the year, all the gain is taxed in that year. If you sell early in the next year, the gain is taxed in the next year. This matters if you are close to a tax bracket threshold or if your income varies year to year. Closing the sale in December versus January can shift the gain to a year when your other income is lower, potentially lowering your overall tax rate.
This strategy works best if you have control over the closing date and your income is predictable. If you are retiring, taking a sabbatical, or expecting a bonus or large income in one year, timing the sale to the lower-income year can save money. Discuss this with your tax professional before you list the property. Some sellers close in stages—selling the building in one year and the land in another—though the IRS scrutinizes this and it only works if the land and building can genuinely be separated.
Selling at a loss and using it to offset other gains
If you sell the rental property for less than your adjusted basis, you have a capital loss. You cannot deduct a capital loss from ordinary income (with narrow exceptions for real estate professionals). However, you can use the loss to offset capital gains from other investments in the same year or carry it forward to future years. If you have other investment income—stocks, bonds, or other rental properties sold at a gain—selling a rental at a loss can offset that gain and reduce your overall tax bill.
This is not a way to avoid taxes on a profitable sale, but it is a way to use a loss strategically. If you own multiple rental properties and one is underwater, selling it to harvest the loss and offset gains from selling another property can lower your total tax.
Working with a tax professional before you sell
The biggest mistake rental property owners make is waiting until after the sale closes to talk to a tax professional. By then, the structure of the deal is locked in and your options are limited. A tax professional should review your situation before you list the property. They can calculate your likely tax bill, identify improvements you may have forgotten, model the cost of a 1031 exchange versus paying tax, and advise on timing.
Bring your purchase documents, all receipts for improvements, your depreciation schedule (from your tax returns), and the expected sale price. A good tax professional can often find deductions or strategies that save more than their fee. They can also coordinate with your real estate agent and title company to may support the closing statement is structured correctly.
Frequently Asked Questions
Can I deduct the cost of selling—realtor commission, closing costs, title insurance—from my gain?
Yes. Selling expenses reduce your net proceeds and therefore reduce your taxable gain. Keep all closing statements and realtor agreements. These are subtracted from the sale price before calculating your gain.
What if I used the rental property as my primary residence for part of the time I owned it?
The Section 121 exclusion lets you exclude up to $250,000 of gain ($500,000 if married filing jointly) if you lived in the home as your primary residence for at least two of the last five years before the sale. If you lived there part-time and rented it part-time, you may be able to exclude a portion of the gain. This is complex and depends on how long you lived there versus rented it. Work with a tax professional.
Do I have to report the sale to the IRS even if I have no gain?
Yes. You must report the sale on Form 8949 and Schedule D, even if you break even or have a loss. The title company will issue a Form 1099-S if the sale price exceeds a threshold (varies by state), and the IRS will receive a copy.
Can I avoid taxes by gifting the property to a family member instead of selling it?
No. If you gift the property, you do not pay tax, but the recipient inherits your cost basis. If they later sell, they owe tax on the gain from your original purchase price. However, if you hold the property until you die, your heirs receive a "stepped-up basis"—their cost basis is the property's value on the date of your death, not your original purchase price. This can eliminate or greatly reduce the tax burden on a future sale. This is an estate planning strategy, not a way to avoid taxes on your own sale.
What is the difference between a 1031 exchange and a like-kind exchange?
They are the same thing. The term comes from Section 1031 of the tax code, which allows exchanges of "like-kind" property. For real estate, "like-kind" is very broad—any rental property qualifies, whether it is a house, apartment building, commercial property, or land. You do not have to exchange a house for a house; you can exchange a house for an apartment building or vacant land.