This article is for general information only and is not tax or legal advice. Tax rules change and your situation may differ, so talk to a licensed CPA or tax attorney before you list your property.
Selling a rental property feels exciting until you see the tax bill. Many owners plan the sale, set a price, and then get hit with a surprise.
Capital gains tax, depreciation recapture, and sometimes a third tax can all apply at once. Together they can eat into the profit you worked years to build.
You have real, legal options. You can defer the tax, lower it, or in some cases skip it entirely. This blog breaks down each option step by step, in plain language.
We cover every major strategy, from 1031 exchanges to smart timing to often missed deductions. We also flag the mistakes that cost sellers the most money.
By the end, you will know which path fits your situation and what to ask your CPA before you sign anything.
What the IRS Actually Taxes When You Sell
When you sell a rental property, you are not dealing with one tax. You are dealing with two, and sometimes three.
1. Capital gains tax: This tax applies to the profit from the property going up in value.
For 2026, long-term capital gains, meaning property held more than one year, get taxed at 0%, 15%, or 20%, depending on your taxable income.
Short-term gains, on property held one year or less, get taxed as ordinary income, up to 37%. (Source: IRS Topic 409)
2. Depreciation recapture: Every year you own a rental, you deduct depreciation on the building. When you sell, the IRS "recaptures" that benefit and taxes it at a flat 25% rate, no matter your income bracket.
This is called unrecaptured Section 1250 gain, and it applies to all the depreciation you claimed, or could have claimed, even if you never took the deduction on your tax return. (Source: IRS Publication 946)
3. Net Investment Income Tax (NIIT): If your income is high enough, an extra 3.8% surtax applies to your investment income, including the gain from a rental sale.
This surtax kicks in above $200,000 in modified adjusted gross income for single filers, and $250,000 for married couples filing jointly. (Source: IRS Topic 559)
A Worked Example
Say you bought a rental property for $300,000. Over 10 years, you claimed $80,000 in depreciation, which lowered your cost basis to $220,000. You then sell the property for $450,000.
- Total gain: $450,000 minus $220,000 = $230,000
- The IRS taxes $80,000 of that as depreciation recapture, at 25%: $20,000
- The remaining $150,000 counts as regular capital gain. At a 15% long-term rate, that adds $22,500.
- If your income triggers the 3.8% NIIT on the full gain, that adds $8,740.
Your total federal tax lands at roughly $51,240, or about 22% of the total gain, before any state tax. This blended rate is rarely a single number.
It depends on how much of your gain is depreciation versus appreciation, and where your income lands in the bracket.
Legal Strategies to Reduce What You Owe
The tax code gives rental property sellers several legal paths to lower their bill. Each strategy works differently, so pick the one that matches your timeline and goals.
1. The 1031 Exchange
Under IRC Section 1031, you can sell a rental property and roll the proceeds into a similar investment property.
You avoid paying capital gains tax or depreciation recapture at the time of sale. Both taxes get deferred, not eliminated.
A Qualified Intermediary must hold your sale proceeds. You cannot touch the money directly, or the IRS disqualifies the exchange.
You have 45 days from closing to identify a replacement property, and 180 days to close on it, and these deadlines allow no exceptions.
A Delaware Statutory Trust can also qualify as a 1031 replacement property. This option lets investors go fully passive instead of managing another property directly.
2. Convert the Rental Into Your Primary Residence
Under IRC Section 121,you can exclude up to $250,000 of gain if single, or $500,000 if married filing jointly.
To qualify, you must live in the property as your main home for at least two of the five years before selling. The two years do not need to be back to back.
Depreciation recapture is never excluded. That 25% tax still applies regardless of this exclusion.
If you used the property as a rental at any point after 2008, a portion of your gain also does not qualify, based on how long it was a rental versus a primary home. (Source: IRS Publication 523)
3. Qualified Opportunity Zone Funds
You can defer your capital gains by reinvesting the profit into a Qualified Opportunity Fund within 180 days of the sale.Under the original rules, deferred gains had to be recognized by December 31, 2026.
Starting January 1, 2027, the One Big Beautiful Bill Act of 2025 replaces that fixed deadline with a rolling 5-year deferral period. It also adds a 30% step-up in basis after five years.
Hold the fund investment for 10 years, and any new gains on it become tax-free. (Source: IRS Opportunity Zones FAQ)
4. Installment Sales
Under IRC Section 453, the buyer pays you over several years instead of in one lump sum.
You only pay tax on each payment as you receive it, which spreads your gain across multiple tax years and can keep you in a lower bracket.
Depreciation recapture does not spread out the same way. You generally must recognize and pay that portion in the year of sale, regardless of the payment schedule.
If you charge the buyer little or no interest, the IRS applies imputed interest rules and taxes part of each payment as ordinary income anyway. You also cannot combine installment sales with a 1031 exchange.
5. Tax-Loss Harvesting
If you hold other investments that have lost value, you can sell them in the same year as your rental to offset part of your gain. For example, a $20,000 loss against a $70,000 gain leaves only $50,000 taxable.
If your losses exceed your gains, you can deduct up to $3,000 against ordinary income per year, and you carry the rest forward to future years.
Watch the wash sale rule: if you buy back a substantially identical security within 30 days before or after the sale, the IRS disallows the loss.
This strategy does nothing for depreciation recapture, which stays taxed separately. (Source: IRS Topic 703)
6. A Charitable Remainder Trust (CRT)
A CRT is an irrevocable trust. You transfer the property into it, and the trust sells the property tax-free since it counts as a tax-exempt entity.
You then receive income from it over time, plus an upfront income tax deduction for the value that will eventually go to charity.
A CRT does not eliminate tax. It spreads the tax out and reclassifies it, using a four-tier system set by IRC Section 664:
- Ordinary income first: interest, non-qualified dividends, and short-term gains, taxed at your regular income rate.
- Capital gain income second: long-term gains, taxed at capital gains rates.
- Tax-free income third: income from municipal bonds or similar sources.
- Return of principal last: not taxed at all.
To use a CRT, you must own the property free of debt. You also permanently give up direct ownership once you transfer it.
At the end of the trust term, at least 10% of the original contributed value must go to your chosen charity. (Source: IRS Charitable Remainder Trust rules)
7. A Self-Directed IRA or Solo 401(k)
A self-directed IRA or solo 401(k) can hold real estate directly. Gains inside the account grow tax-deferred, or tax-free in a Roth account, and selling inside the account does not trigger an immediate capital gains bill.
The rule that trips people up is Unrelated Debt-Financed Income (UDFI), not withdrawal timing. If your IRA uses a loan to buy the property, the IRS taxes the portion of income tied to that debt under Unrelated Business Income Tax (UBIT), whether or not you ever withdraw the money.
Solo 401(k) plans often skip UDFI on qualifying acquisition debt, which is one reason investors favor them for leveraged real estate. Buying the property outright avoids UBIT and UDFI entirely. (Source: IRS Unrelated Business Income Tax overview)
Comparing the Strategies at a Glance
Each strategy fits a different goal, timeline, and financial situation.
Use this table to quickly match your situation to the right option before you dig into the details above:
| Strategy | Defers or eliminates tax | Key deadline | Best fit for |
| 1031 Exchange | Defers both taxes | 45 days to identify, 180 days to close | Investors growing their real estate portfolio |
| Section 121 exclusion | Eliminates gain up to the limit (not recapture) | Must live in home 2 of last 5 years | Owners converting a rental back into a primary home |
| Opportunity Zone Fund | Defers, then can eliminate new gains after 10 years | 180 days to invest | Investors comfortable with a long hold in a designated zone |
| Installment sale | Spreads out capital gains tax only | None, but recapture is due in year of sale | Sellers who want steady income and a lower bracket each year |
| Tax-loss harvesting | Offsets gain with losses | Same tax year | Investors who also hold underperforming assets |
| Charitable Remainder Trust | Defers and reclassifies gain over time | Must be set up before the sale | Owners with charitable intent and a debt-free property |
| Self-directed IRA / Solo 401(k) | Defers or eliminates (Roth) | None | Long-term investors building retirement wealth through real estate |
Timing Your Sale
Holding a property for more than one year qualifies you for long-term capital gains rates instead of ordinary income rates. That difference alone can mean the gap between a 15% rate and a 37% rate.
Selling in a year when your income is lower, such as after retirement, can also help.
For 2026, the 0% long-term capital gains rate applies to single filers with taxable income up to $49,450, and married couples filing jointly up to $98,900. (Source: IRS Revenue Procedure 2025-32)
State Taxes Matter Too
Federal tax is only part of the picture, and states handle capital gains very differently.
Some states charge no state income tax at all, so they charge no state capital gains tax either. This group includes Texas, Florida, Nevada, Washington, Wyoming, South Dakota, Alaska, and Tennessee.
Other states tax gains as ordinary income, with high top rates.California charges up to 13.3%, and New York charges up to 10.9% at the state level, plus New York City adds its own tax on top.
States like Illinois and Pennsylvania fall in between, taxing gains at their standard flat income tax rate.
If you have flexibility in where you hold residency when the sale closes, factor this in alongside the federal strategies above.
Deductions That Lower Your Taxable Gain Before You Sell
Every dollar you track before the sale can lower the gain of the IRS taxes later.
These four deduction types matter most for rental property owners:
Repairs
The IRS lets you deduct costs that restore the property to its original condition in the year they happen. These deductions lower your rental income each year, not your gain at sale.
Depreciation
Residential rental property gets depreciated over 27.5 years under the Modified Accelerated Cost Recovery System (MACRS). Only the building gets depreciated, not the land.
This deduction shields your rental income year to year, but the IRS recaptures all of it and taxes it at 25% when you sell. (Source: IRS Publication 946)
Selling Costs
You can subtract agent commissions, attorney fees, title insurance, transfer taxes, and advertising costs from your reported gain at closing.
These costs directly reduce the profit the IRS taxes.
Capital Improvements
A new roof, HVAC system, kitchen remodel, or addition all raise your cost basis, which lowers your taxable gain.Unlike repairs, the IRS requires you to depreciate improvements over time rather than deduct them immediately.
Keep every receipt, since a higher basis means a smaller taxable gain at sale. (Source: IRS Publication 527)
If You Inherited the Property
Inherited property gets a stepped-up basis under IRC Section 1014.
Your cost basis resets to the fair market value on the date the previous owner died, not what they originally paid.
If you sell soon after inheriting, you likely owe little or no capital gains tax. Some estate attorneys pair lifetime 1031 exchanges with step-up basis planning, so heirs inherit a property with a fresh basis.
This approach involves complex estate rules, so review it with an estate attorney and CPA.
(Source: IRS Publication 559)
Foreign Rental Properties
US citizens and residents must report foreign rental sales the same way as domestic sales.
The Foreign Tax Credit, under IRC Section 901 and claimed on Form 1116, lets you subtract taxes you paid abroad from your US bill, often down to zero if the amounts match.
Work with a cross-border tax specialist for these filings. (Source: IRS Form 1116 instructions)
Common Mistakes That Cost Sellers Money
Even a solid tax plan falls apart when a small detail gets missed.
These four mistakes cost sellers the most money, and all of them are avoidable:
- Missing 1031 deadlines: The IRS allows no exceptions, even for personal circumstances.
- Losing track of depreciation: Keep records from day one so your CPA can calculate recapture accurately using Form 4797.
- Selling to a related party at a loss: Under IRC Section 267, the IRS disallows losses on sales to family members or a corporation you control. The buyer must be unrelated, and the price must reflect fair market value.
- Skipping professional advice: A mistake in a 1031 exchange or Opportunity Zone filing can cost far more than a CPA's fee. Talk to a CPA or tax attorney before you list the property, not after.
Conclusion
The tax bill on a rental sale is rarely fixed. It bends based on the choices you make before you list the property. Pick your strategy early, track your numbers, and talk to a CPA before you sign anything.
That one step can save you thousands.
If this helped you plan your sale, share it with someone who is selling too. Drop a comment below and tell us which strategy fits you best.
Frequently Asked Questions
Can I avoid capital gains tax by reinvesting in something other than real estate?
No. The 1031 exchange only applies to like-kind real estate.
Do I owe taxes if I sell my rental at a loss?
You owe no capital gains tax on a loss. You may be able to use that loss to offset other investment gains in the same year, subject to the related-party rule above.
How does selling a rental property affect Social Security benefits?
The profit counts as income in the year you receive it. If it pushes your total income above certain IRS thresholds, up to 85% of your Social Security benefits can become taxable that year. (Source: Social Security Administration)
Does holding property in an LLC or S-Corp reduce taxes?
Not automatically. Tax treatment depends on how the entity is structured and classified by the IRS.
What is the difference between capital gains tax and transfer tax?
Capital gains tax is a federal tax on your profit. Transfer tax is a state or local fee charged on transferring ownership, whether or not you made a profit.





