What happens to capital gains tax when you sell rental property

Capital gains tax is the tax you owe on the profit when you sell rental property for more than you paid for it. The IRS taxes this profit as income, and the rate depends on how long you owned the property. If you owned it for more than one year, you pay long-term capital gains rates (0%, 15%, or 20%, depending on your total income). If you owned it for one year or less, you pay your ordinary income tax rate, which is usually higher.

You cannot avoid capital gains tax on rental property sales entirely — the tax is owed when you sell at a profit. However, there are legal ways to reduce the amount of tax you owe. The most common method is depreciation recapture, which works differently than you might expect. Other strategies involve timing, property exchanges, or charitable donations. Each has specific rules and limits.

Key Takeaways

  • Long-term capital gains rates (15% or 20% for most people) apply only if you owned the property for more than one year before selling.
  • Depreciation you claimed on your tax returns reduces your profit calculation, but the IRS recaptures that depreciation at 25% when you sell, which is higher than your capital gains rate.
  • A 1031 exchange lets you defer capital gains tax by reinvesting the sale proceeds into another rental property of equal or greater value within strict timelines.
  • Your cost basis — the original purchase price plus improvements — directly reduces your taxable profit, so keeping records of all repairs and upgrades matters.
  • Selling at a loss wipes out capital gains tax for that year and lets you carry unused losses forward to future years.

How depreciation recapture increases your tax bill

Depreciation is an annual deduction you claim on your tax return for the wear and tear on a rental building. Over 27.5 years, you deduct a portion of the building's cost each year, which reduces your taxable rental income. This is a real tax benefit while you own the property.

When you sell, the IRS recaptures all the depreciation you claimed and taxes it at 25% — not at your capital gains rate. This is true even if your capital gains rate is only 15%. For example, if you claimed $50,000 in depreciation over ten years, you owe $12,500 in recapture tax (25% of $50,000) when you sell, separate from capital gains tax on your actual profit. This recapture is mandatory; you cannot avoid it by holding the property longer or using another strategy.

Using a 1031 exchange to defer capital gains tax

A 1031 exchange is a transaction where you sell rental property and reinvest all the proceeds into another rental property without paying capital gains tax at the time of sale. The tax is deferred, not erased — you will owe it when you eventually sell the new property without doing another exchange. However, if you keep exchanging into new properties, you can defer the tax indefinitely.

The rules are strict. You have 45 days from the sale closing date to identify the replacement property in writing. You have 180 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. You cannot touch the sale proceeds yourself — a may have access to intermediary (a neutral third party) must hold the money during the waiting period. If you miss either deadline or buy a cheaper property, the entire transaction fails and you owe capital gains tax on the original sale.

Depreciation recapture still applies in a 1031 exchange. You do not avoid the 25% recapture tax; you only defer the capital gains portion of your profit. Many investors use 1031 exchanges to upgrade to larger or better-performing properties while postponing the tax bill.

Reducing your taxable profit through cost basis

Your cost basis is the amount the IRS uses as your starting point for calculating profit. It includes the purchase price plus the cost of capital improvements — permanent upgrades that add value or extend the property's life. Capital improvements include a new roof, foundation work, new HVAC system, or an addition. They do not include repairs, which are deductible annually but do not reduce basis.

The difference between a repair and an improvement matters. Painting the exterior is a repair. Replacing rotten siding is an improvement. Fixing a leaky faucet is a repair. Replacing all plumbing is an improvement. If you can document that work as a capital improvement, you add it to your cost basis, which reduces your taxable profit when you sell.

Keep receipts and invoices for all work done on the property. When you sell, provide your tax preparer with a complete list of improvements and their costs. This documentation directly reduces the amount of capital gains tax you owe. The IRS may request proof, so detailed records are essential.

Timing the sale to use capital loss carryforwards

If you sell a rental property at a loss, you cannot deduct that loss against your rental income in most cases — real estate loss deductions have strict limits. However, you can use the loss to offset capital gains from other investments in the same year. If the loss is larger than your gains, you can carry the unused loss forward to future years, up to $3,000 per year against ordinary income, with the remainder rolling forward indefinitely.

This strategy works if you own multiple properties or investment accounts. If you have a property worth less than you paid for it, selling it can offset capital gains from selling another property at a profit. You pay tax only on the net gain. This requires planning across your entire investment portfolio, not just one property.

Charitable donations and conservation easements

Donating rental property to a may have access to charity can eliminate capital gains tax on that property. You receive a charitable deduction for the property's fair market value, and you owe no capital gains tax on the donation itself. However, you lose the property and all future rental income from it, so this strategy makes sense only if the property is underperforming or you have other reasons to exit.

A conservation easement is a more complex tool. You donate the development rights to a property to a land trust or government agency, which restricts future use. You receive a charitable deduction based on the value of the rights you gave up, which can offset capital gains. You keep ownership and can continue renting the property, but you cannot develop it. This requires professional appraisal and legal work, and the IRS scrutinizes these transactions closely.

What does not reduce capital gains tax

Holding the property for a very long time does not reduce your capital gains rate — it stays at 15% or 20% as long as you owned it over one year. Reinvesting the proceeds into another property does not reduce the tax unless you use a 1031 exchange. Making improvements to the property before selling does not reduce capital gains tax (though it may increase the sale price, which increases your profit and your tax bill).

Your primary residence has special rules — you can exclude up to $250,000 of gain if you are single or $500,000 if married filing jointly, provided you owned and lived in the home for two of the last five years. Rental property does not may have access to for this exclusion, even if you once lived there.

Frequently Asked Questions

Do I have to pay capital gains tax if I sell my rental property at a loss?

No. If you sell for less than you paid, you have no capital gains tax. You cannot deduct the loss against rental income due to passive loss limits, but you can use it to offset capital gains from other investments or carry it forward to future years.

Can I avoid capital gains tax by gifting the property to my children?

Gifting avoids your capital gains tax, but your children inherit the property at its fair market value on the date of your death (called a "stepped-up basis"). If they sell shortly after, they owe little or no capital gains tax. If you gift while alive, they inherit your original cost basis and owe capital gains tax if they sell at a profit. Gifting during life does not reduce total tax; it only shifts when it is owed.

What if I sell rental property in a different state than where I bought it?

Capital gains tax is federal and applies regardless of state. Some states also tax capital gains or have no income tax. Your state of residence when you sell determines state tax, not where the property is located. Consult a tax professional in your state for state-specific rules.

Does the 1031 exchange work if I sell one rental property and buy two smaller ones?

Yes, as long as the combined value of the two properties is equal to or greater than the property you sold. You can exchange into multiple properties, but the identification and closing deadlines still apply to all of them.

Can I deduct the cost of selling the property, like realtor commissions, from my capital gains?

Yes. Selling costs — realtor commissions, title insurance, attorney fees, and transfer taxes — reduce your net proceeds and therefore reduce your taxable profit. These are not separate deductions; they lower the amount of gain you calculate in the first place.