How to avoid capital gains tax when you sell a rental property

A steady stream of rental income, property appreciation over the long-term, and reducing taxable income with business expenses and depreciation are just a few of the advantages of investing in single-family rental property.

However, when a property is sold the IRS tries to make investors pay for those advantages by collecting a tax on the capital gain. Fortunately, there are several strategies a real estate investor can use to avoid paying the capital gains tax on rental property.


What is a capital gain?

A capital gain is the net profit made when a capital asset is sold. 

According to the IRS, almost everything owned and used for investment purposes is a capital asset. When the asset is sold, the capital gain (or loss) is calculated by subtracting the realized sale price from the adjusted basis.

There are four important terms to understand when determining a capital gain:

  • Capital asset: stocks and bonds, equipment and machinery, furniture and fixtures, and real estate.
  • Adjusted basis: original price paid for the capital asset, including fees paid for buying the property such as legal and recording fees, surveys and transfer taxes, title insurance and sales commissions.
  • Short-term capital gain: capital assets held for one year or less before being disposed of.
  • Long-term capital gain: capital assets held for more than one year before being disposed of.



How capital gains are taxed

Holding an asset for more than one year before disposing of or selling it has a significant impact on the amount of tax potentially owed to the IRS. That’s because short-term gains are taxed as ordinary income at the normal 2023 tax bracket ranges of 10%, 12%, 22%, 24%, 32%, 35%, and 37%.

On the other hand, long-term capital gains tax rates are much lower, ranging between:

  • 0% for personal incomes of up to $40,400
  • 15% for personal incomes of between $40,401 to $445,850
  • 20% for personal incomes of $445,850 or higher 

Short-term vs. long-term capital gains tax liability

Let’s look at how capital gains are taxed based on a short-term and long-term holding period. For the purposes of this example, we’ve excluded any additional individual state income tax due.


  • Adjusted basis = $200,000
  • Net sales price = $250,000
  • Taxable gain = $50,000
  • Capital gains tax due (at 24% ordinary income bracket) = $12,000


  • Adjusted basis = $200,000
  • Net sales price = $250,000
  • Depreciation recapture = $7,200
  • Taxable gain = $50,000 + $7,200 depreciation recapture = $57,200
  • Capital gains tax due (15% at mid-range capital gains tax rate) = $8,580

In this example, the real estate investor with a short-term investment strategy pays nearly 40% more in capital gains tax ($12,000 - $8,580 = $3,420) than an investor with a longer-term investment plan.


How depreciation recapture works

The IRS requires real estate investors holding property over the long term to recapture – or give back – the annual non-cash depreciation deduction made to reduce taxable net income. 

For depreciation tax purposes, residential rental property is assumed to have a useful life of 27.5 years. In the “Long-term” section above, roughly one year of depreciation was recaptured. The most recent IRS Publication 527 tells investors everything they need to know about residential rental real estate depreciation.



4 ways to avoid capital gains tax on a rental property

When it comes to paying capital gains tax, many real estate investors believe they only have 2 choices: paying a short-term capital gains tax now or paying later at a lower, long-term capital gains tax rate. 

Of course, some taxpayers may feel that it’s their civic duty to pay as much tax as possible. However, simply because other people believe the best use of their money is to give it to the government, it doesn’t mean that you have to, too.

Here are 4 strategies you can use to avoid, reduce, and defer paying any capital gains tax at all.


1. Purchase properties using your retirement account

Tax-deferred retirement accounts such as an IRA, Roth IRA, or 401(k) plan allow investors to buy rental properties with their retirement savings while also allowing rental income and capital gains to accumulate tax-free until an investor begins to make withdrawals.

IRA contributions are also a tax return deduction, capital accumulates tax-free, and money can be withdrawn when the investor retires at a lower tax bracket.


2. Convert the property to a primary residence

Converting a rental property into a primary residence allows real estate investors to exclude up to $500,000 in taxable capital gains, or $250,000 for taxpayers who are single. 

Let’s use the $200,000 rental property we discussed earlier as an example.

Assume that over the last ten years the property has consistently appreciated and now has a net sales price of $300,000. If an investor sells, the capital gain would be $100,000 and the potential capital gains tax due would be $15,000 (assuming the mid-range capital gains income bracket and ignoring depreciation recapture).

By making the rental property the primary residence, Section 121 of the Internal Revenue Code allows an investor to reduce paying capital gains tax by:

  • Owning the home for at least 2 of the preceding 5 years before selling it
  • Using the home as the primary residence for at least 2 of the same preceding 5 years
  • Not excluding capital gains tax from any other sale within the last 2 years

Real estate investors considering converting an investment property into their primary residence should always talk to their trusted tax advisor. That’s because factors such as depreciation recapture, potentially selling for a loss, and qualified vs. non-qualified use can affect the amount of reduced capital gains.


3. Use tax harvesting

Tax harvesting occurs when investors sell one rental property at a loss to offset the gains of another property sold during the same tax year. Tax-loss harvesting is a strategy many investors use with stocks, because they’re easy to sell online just before the year ends.

Real estate investors can also use tax harvesting with rental property to match gains with losses from other investments. For example, the $50,000 capital gain from the sale of our rental property above could be offset by selling another rental property with negative equity of $40,000 to reduce the investor’s total taxable capital gain to only $10,000. 


4. Use a 1031 tax deferred exchange

Section 1031 of the Internal Revenue Code allows real estate investors to sell a rental property, buy another property at an equal or greater value, and defer paying tax on the capital gains. The IRS also calls 1031 exchanges “like-kind” exchanges, although that phrase can be a little misleading. For example, property is considered by the Internal Revenue Service to be like-kind as long as it is the same nature or character. 

So, relinquishing a single-family rental property and replacing it with a larger rental property portfolio would qualify as a like-kind Section 1031 exchange. The same would be true for selling a commercial property like an office building in exchange for buying a group of single-family rental homes.

In fact, Roofstock makes it easy for real estate investors to maximize a 1031 exchange



How to minimize your taxable gains

When new real estate investors start building their rental property portfolio they’re oftentimes pleasantly surprised at how tax-friendly the IRS is with property owners. Real estate tax laws in the U.S. allows investors to lower the amount of taxable income and defer paying capital gains tax by:

  • Deducting normal business operating expenses such as a home office and the cost of traveling to check on rental property and meet with local property management
  • Reducing gross operating income with mortgage interest expense deductions
  • Using non-cash depreciation expenses to minimize the amount of taxable income
  • Deferring the tax on a realized capital gain by using a 1031 exchange to purchase a replacement property of equal or greater value

Techniques to increase your property basis

Examples of rental property improvements and transaction expenses that can increase the basis of a property and lower the amount of potential capital gain include:

  • Upgrading doors and windows
  • Replacing heating and cooling systems, electrical, and plumbing
  • New appliances, flooring, and roofing
  • Real estate sales commissions
  • Appraisal, legal, and inspection fees
  • Title search fees, transfer taxes, and escrow and closing settlement costs

FAQs on avoiding capital gains on rental property

Question: Does a primary residence qualify for a tax deferred 1031 exchange?

Answer: No. Section 1031 of the Internal Revenue Code only allows real property used for business or investment to be used in a like-kind exchange.

Question: Can I use other assets like stocks and bonds in a Section 1031 exchange?

Answer: No. When the Tax Cuts and Jobs Act was passed in December 2017, like-kind exchange tax treatment became generally limited to real property exchanges only.

Question: How does tax law affect real estate investment strategy?

Answer: Tax law encourages a buy-and-hold real estate investment strategy with lower long-term capital gains rates, depreciation expense, and investor-friendly tax deductions for interest and operating expenses.

Question: Can capital losses in one year be used to offset gains in future years?

Answer: Yes. The IRS limits capital loss deductions (the net difference between total gains and losses) to $3,000 per year. However, capital loss amounts in excess of $3,000 can be carried forward to future years. 


Final thoughts

Real estate investors who don’t plan ahead run the very real risk of losing a big percentage of their profits to capital gains tax owed when a property is sold. With the right strategies, single-family investors can avoid, reduce, and defer paying capital gains tax on rental property:

  • Invest in rental property using a tax-deferred retirement account
  • Convert a rental property into a primary residence
  • Offset gains and losses with tax harvesting

Of course, selling a property doesn’t mean getting out of the real estate investing business completely. In fact, many investors scale up their real estate holdings by using a 1031 exchange to trade a one-rental property for a larger portfolio of professionally managed single-family homes.


Click me
This article, and the Roofstock Blog in general, is intended for informational and educational purposes only, and is not investment, tax, financial planning, legal, or real estate advice. Roofstock is not your advisor or agent. Please consult your own experts for advice in these areas. Although Roofstock provides information it believes to be accurate, Roofstock makes no representations or warranties about the accuracy or completeness of the information contained on this blog.
Jeff Rohde


Jeff Rohde

Jeff has over 25 years of experience in all segments of the real estate industry including investing, brokerage, residential, commercial, and property management. While his real estate business runs on autopilot, he writes articles to help other investors grow and manage their real estate portfolios.

Join 100,000+ Fellow Investors.

Subscribe to get our top real estate investing content.

Subscribe Here!