How to Avoid Paying Capital Gains Taxes on a Rental Property

Capital gains taxes are assessed when you sell assets — such as rental properties — at a profit, but you may be able to avoid them in some circumstances.

Woman working on taxes with calculator
Updated May 13, 2024
Fact checked

We receive compensation from the products and services mentioned in this story, but the opinions are the author's own. Compensation may impact where offers appear. We have not included all available products or offers. Learn more about how we make money and our editorial policies.

Real estate investing is a popular way to build wealth, but if you buy rental properties and then sell them at a profit, you could end up owing the IRS a cut of the money you made.

The taxes that apply to real estate gains are called capital gains taxes, which work differently than traditional income taxes. Property owners may also be able to avoid these taxes. Here's what you need to know about how to avoid paying capital gains tax on rental property.

In this article

What are capital gains taxes?

When you’re considering how to invest in real estate, it’s important to keep potential tax liabilities in mind. The IRS takes a cut of all income you earn in the U.S. You're taxed when you earn money from a job, for example. But you're also taxed when assets you own increase in value and you sell them at a profit.

The assets you own for personal or investment purposes are called capital assets. If you can sell them at a higher cost than you paid for them, you experience a capital gain and may have to pay taxes on it. The profit from appreciation in capital assets isn't taxed at the same rate as income, though. Instead, it's subject to capital gains taxes.

There are two types of capital gains taxes you need to know about when learning how to invest money in real estate or other assets. Short-term capital gains, which are taxed at your ordinary income rate as determined by your tax bracket, and long-term capital gains.

Long-term capital gains are taxed at a much lower rate because the government wants to incentivize responsible investing behavior such as buying and holding. The table below shows the long-term capital gains tax rates depending on your tax filing status and your taxable income.

2022 and 2023 capital gains tax rates

Here are the long-term capital gains rates for both the 2022 and 2023 tax years for the various tax filing statuses. The first column indicates the percentage of tax that will be applied to your capital gains. Columns two through five indicate your filing status and income level.

Tax year 2022

Capital gains tax rate AGI – Single filers AGI – Married filing jointly AGI – Head of household AGI – Married filing separately
0% $0 - $41,675 $0 - $83,350 $0 - $55,800 $0 - $41,675
15% $41,676 - $459,750 $83,351 - $517,200 $55,801 - $488,500 $41,676 - $258,600
20% $459,751 or more $517,201 or more $488,501 or more $258,601 or more

Tax year 2023

Capital gains tax rate AGI – Single filers AGI – Married filing jointly AGI – Head of household AGI – Married filing separately
0% $0 - $44,625 $0 - $89,250 $0 - $59,750 $0 - $44,625
15% $44,626 - $492,300 $89,251 - $553,850 $59,751 - $523,050 $44,626 - $276,900
20% $492,301 or more $553,851 or more $523,051 or more $276,901 or more

In addition to these rates, there is an additional capital gains tax for higher-income investors called the net investment income tax rate. This rule adds 3.8% to the capital gains tax for investors over certain income thresholds.

How do capital gains on investment properties work?

Investment properties are capital assets, like other things you invest in, such as stocks. If you sell them at a profit, you will pay capital gains taxes.

To determine whether you are selling at a profit — and how much taxable money you made — you first need to know the asset basis or cost basis. Those are technical tax terms used to describe the total cost of the property.

For most people, the asset basis or cost basis is the amount you paid for the property plus transaction costs and the cost of any major improvements. This includes the total amount paid to buy it, including any money you borrowed to fund your purchase, as well as any commissions and fees you paid that were connected to the purchase. It also includes money you spent to improve the property's value, such as adding a new roof or upgrading the kitchen.

However, if you inherited the investment property or if it was gifted to you, then there may be an "adjusted basis." In this case, the starting value of the property used to calculate your gains could be calculated in several ways, including using the fair market value of the property at the time of the inheritance.

You also need to know the net proceeds from the property sale. That's the amount you net after accounting for commissions and other costs. Once you know the cost basis and net proceeds, you can calculate how much of your profits will be subject to capital gains taxes.

For example, say you spent $360,000 to purchase a property, including the closing costs and initial transaction fees, and then you spent $50,000 upgrading it. You then sold it for $450,000 and incurred $5,000 in transaction costs.

Here's how you'd calculate the amount you'd pay taxes on:

$450,000 sales price
- $5,000 in transaction costs
- $50,000 in substantial improvement expenses
- $360,000 total initial purchase price, including transaction fees

You would pay capital gains taxes on net proceeds of $35,000.

If you had owned the property for more than a year, you would be taxed on this $35,000 at your long-term capital gains rate, which would be 0%, 15%, or 20%, depending on your income. If you owned it for less time, you'd be taxed on the proceeds at your ordinary income tax rate.

If your modified adjusted gross income exceeds $250,000 for married couples filing jointly, $125,000 for married separate filers, $250,000 for qualified widow(er)s with a dependent child, or $200,000 for all other taxpayers, you could also be subject to a 3.8% net investment income tax. This applies regardless of whether your gains are short- or long-term gains.

Strategies to avoid capital gains on rental property

As you can see, capital gains can have a big impact on the amount of profits you keep. But there are ways to avoid paying capital gains taxes on rental properties. Here are some options.

Offsetting losses with gains

You are allowed to claim capital losses in order to reduce capital gains taxes. Capital losses occur when you sell an asset at a loss. For example, if you buy stock for $100 and it decreases in value and you end up selling your shares for $75, you've incurred a $25 loss.

You can use losses to offset gains only if you realize the losses, or actually experience them. If your stock decreased in value, for example, you wouldn't be able to declare the loss if you still owned your shares. As a result, you may decide you want to be strategic about when you sell losing assets.

If you know you are going to make big gains on a particular property during a specific tax year, you may want to sell losing assets during that same year (if you're confident the value won't rebound) so you can harvest the losses and use them to offset the gains. This is called tax loss harvesting. Capital losses can offset an unlimited amount of capital gains. So if you make $35,000 but lose $40,000, you wouldn't have to pay capital gains taxes on the $35,000 in profits.

If your losses exceed your gains, you can also deduct up to $3,000 per year in capital losses from your ordinary taxable income if you are a married joint filer. This number decreases to $1,500 for single tax filers or married separate filers. You can also carry over capital losses to a subsequent year if you have a lot of losses.

1031 exchanges

You may also be able to avoid paying capital gains taxes if you do a 1031 exchange.

Found in Section 1031 of the federal tax code, a 1031 exchange occurs if you use the proceeds from the sale to buy another property, also known as a replacement property. You must follow specific rules and make sure the exchange is a like-kind property exchange, which means the property must be similar in type and nature to the real estate you sold. You could buy another rental property that costs the same, or costs more, in order to fulfill this requirement.

You also have a limited period of time in which to purchase another property with the proceeds from the sale of your current one. Specifically, you must identify another property to purchase within 45 days and close on the new property within 180 days of selling your property or the tax return deadline (including extensions) for the year in which the property was sold.

You also can't take direct control of the sale proceeds in the interim until the new property is purchased. Using an intermediary, like an escrow company, can help you to avoid running into trouble with this aspect of the process.

Convert your rental to a primary residence

Primary residences are subject to different capital gains and home sales tax rules than rental properties. But you have to meet specific requirements in order to convert a rental property to a primary residence. Specifically, you must own and use the property as your principal residence for at least two of the five years preceding the sale date.

If you claimed depreciation as a tax deduction while using the property as a rental property before converting it to a primary residence, you will have to recapture the depreciation deduction and pay a flat 25% tax on it. For example, if you deducted $5,000 for depreciation when using the property as a rental, you would have to pay a depreciation recapture tax equaling 25% of $5,000, or $1,250.

If you meet the requirements for converting the rental property to a primary residence before selling it, you are allowed to exclude up to $250,000 in gains if you are a single filer, or up to $500,000 in gains as a married joint return filer.

These exclusions apply to any primary residence. This means you won't pay capital gains taxes on those gains. However, you cannot claim this exclusion if you excluded the sale of another house during the two years before selling this particular property.

Buy properties with your retirement account

If you invest in assets in a qualifying retirement account such as a 401(k), traditional IRA or Roth IRA, you can defer the payment of taxes if you sell the assets in the account at a profit.

You can only invest in real estate in a retirement account if the account is a self-directed account. Most employers and individual retirement accounts with standard brokerage firms are not self-directed, and you won't be able to make real estate investments. But some financial firms do allow you to open self-directed accounts that you can use to buy any assets you'd like — including real estate.

You also must maintain an arms-length distance from the investment, so you or close relatives can't live in the property or actively manage it. All proceeds from the property must also go back into the retirement account.


Can you sell rental property and not pay capital gains tax?

It is sometimes possible to sell rental property and not pay capital gains on the proceeds. You can do this by:

  • Selling losing investments and offsetting your gains with the resulting capital losses.
  • Doing a 1031 exchange and using the proceeds from the sale of the property to purchase a similar investment property within 180 days.
  • Converting the rental property to a primary residence by owning and living in it for two of the five years before its sale so you can claim an exclusion for up to $250,000 or $500,000 in gains (depending whether you are a single or married joint filer).
  • Using a self-directed retirement account to make your real estate investment.

How is capital gains tax calculated on the sale of rental property?

Capital gains tax is calculated based on net proceeds minus the cost basis of the property. Net proceeds refer to the sale price after transaction costs and minus the cost basis. The cost basis, in most cases, refers to the initial purchase price of the property plus any transaction costs and money spent on substantial improvements. If a property was gifted or inherited, the cost basis may be different.

If the property was owned for less than a year, the owner will pay short-term capital gains and be taxed at their ordinary income tax rate. If it was owned for more than a year, the owner will pay long-term capital gains taxes and will be taxed at 0%, 15%, or 20%, depending on income.

How long do you have to live in a rental property to avoid capital gains tax?

You can avoid capital gains taxes on up to $250,000 in gains for single tax filers or $500,000 in gains for married joint filers if you successfully convert a rental property to a primary residence and meet the requirements for excluding gains. You must own and use the property as your primary residence for at least two of the five years before the sale to take advantage of the capital gains tax exclusion.

Bottom line

Capital gains tax can take a bite out of your profits if you are a successful real estate investor. But as you can see, there are plenty of ways to lower your tax bill when the property you own goes up in value. The best tax software or an experienced real estate tax professional can help you to understand your tax-saving opportunities.

Crowdstreet Benefits

  • Get access to unparalleled institutional commercial real estate
  • CrowdStreet has launched 560 deals
  • $360M in investor distributions and new deals listed with high frequency
  • Limited to accredited investors

Author Details

Christy Rakoczy

Christy Rakoczy has a Juris Doctorate from UCLA Law School with a focus in Business Law, and a Certificate in Business Marketing with an English Degree from The University of Rochester. As a full-time personal finance writer, she writes about all things money-related but her special areas of focus are credit cards, personal loans, student loans, mortgages, smart debt payoff strategies, and retirement and Social Security. Her work has been featured by USA Today, MSN Money, CNN Money and more, and you can learn more at her LinkedIn profile.