You can reduce capital gains tax on real estate through timing, reinvestment, and ownership structure

Capital gains tax on real estate is not inevitable. You have several levers: you can exclude up to $250,000 of gain if you lived in the home ($500,000 if married filing jointly), reinvest proceeds into another property under a 1031 exchange, spread the gain over multiple years using an installment sale, or hold the property until death so your heirs receive a stepped-up basis. Each route has different requirements and trade-offs.

The strategy that works depends on how long you owned the property, whether it was your primary home, your tax bracket, and your plans for the money. Some strategies stack — for example, you can use the primary residence exclusion and also time the sale to avoid a higher tax bracket. Others are mutually exclusive: you cannot use both a 1031 exchange and the primary residence exclusion on the same sale.

Key Takeaways

  • The primary residence exclusion lets you exclude $250,000 of gain (or $500,000 if married) if you owned and lived in the home for at least two of the last five years before sale.
  • A 1031 exchange defers all capital gains tax by reinvesting the sale proceeds into another investment property, but the replacement property must be identified within 45 days and closed within 180 days.
  • An installment sale spreads the gain across multiple tax years, potentially keeping you in a lower bracket each year, though you receive payments over time instead of a lump sum.
  • Holding property until death gives your heirs a stepped-up basis, meaning they inherit at current market value with no capital gains tax owed on appreciation during your lifetime.
  • Investment properties and rental homes have fewer exclusions than primary residences, so your ownership type and use of the property determine which strategies are available.

The primary residence exclusion: $250,000 or $500,000 tax-free

If you sell a home you lived in, you can exclude $250,000 of capital gain from federal income tax ($500,000 if you are married filing jointly). This is the Section 121 exclusion, and it is the most common way people avoid capital gains tax on real estate.

To use it, you must have owned the home and lived in it as your primary residence for at least two of the five years before the sale. The two years do not have to be consecutive. If you owned it for 18 months and then rented it out for two years before selling, you do not may have access to. If you owned it for three years and lived there for two, you do. The exclusion applies once every two years. If you sold a home in 2022 and used the exclusion, you cannot use it again until 2024.

If you are married, both spouses must meet the ownership and use test to claim the full $500,000 exclusion; if only one spouse meets the test, the exclusion is $250,000. Any gain above the exclusion amount is taxed as a long-term capital gain (assuming you held the property more than one year). Long-term rates are lower than ordinary income rates — 0%, 15%, or 20% depending on your total income — but you still owe tax on the excess.

1031 exchanges: defer all tax by buying another investment property

A 1031 exchange (named after Section 1031 of the tax code) lets you sell one investment property and buy another without paying capital gains tax on the sale. The tax is deferred, not erased — you will owe it when you eventually sell the replacement property, unless you do another 1031 exchange at that time.

The rules are strict and the timeline is fixed. You must identify the replacement property within 45 days of closing the sale. You must close on the replacement property within 180 days of closing the sale. You cannot touch the sale proceeds yourself; a may have access to intermediary (a neutral third party) must hold the money. If you withdraw any of it, that portion is taxed when ready.

The replacement property must be of equal or greater value and must be real estate held for investment or business use. You cannot exchange a rental house for a primary residence, or a commercial building for raw land and come out ahead on the exchange — though the IRS does allow exchanges between different types of investment property. If you sell a property for $500,000 and buy one for $400,000, you owe tax on the $100,000 difference (called boot).

1031 exchanges are useful if you want to move your money from one property to another without triggering a large tax bill in the year of sale. They are common among real estate investors who buy, hold, and trade up over time. They require planning and a may have access to intermediary, which typically costs $500 to $1,500 in fees.

Installment sales: spread the gain across multiple years

An installment sale is a contract where the buyer pays you over time instead of in a lump sum at closing. You report the gain proportionally as you receive payments, which can keep you in a lower tax bracket each year.

For example, if you sell a rental property for $500,000 with a $100,000 gain, and the buyer pays you $100,000 per year for five years, you report $20,000 of gain each year instead of $100,000 in year one. If your ordinary income is $80,000 per year, reporting an extra $20,000 of gain keeps you in a lower bracket than reporting $100,000 in a single year.

Installment sales work for both primary residences and investment properties, but they require a willing buyer and a promissory note. You also carry the risk that the buyer defaults on payments. If the buyer stops paying, you may have to foreclose, which is expensive and time-consuming. You also do not receive all your money upfront, which matters if you need liquidity.

Installment sales are less common than they once were because most buyers finance through a bank, not the seller. They are most useful when you are selling to a buyer with limited access to traditional financing or when you want to stay in a lower tax bracket.

Stepped-up basis at death: no capital gains tax for your heirs

When you die, your heirs inherit property at its fair market value on the date of your death. This is called a stepped-up basis. If you bought a home for $200,000 and it is worth $500,000 when you die, your heirs inherit it at $500,000. If they sell it when ready, they owe no capital gains tax on the $300,000 appreciation that happened during your lifetime.

This is a powerful tool for deferring tax indefinitely — or erasing it entirely if your heirs hold the property long enough. It applies to all real estate, including investment properties and rental homes. It does not explore to other assets like stocks or bonds held in a regular brokerage account, though those also receive a stepped-up basis at death.

The stepped-up basis is not a strategy you can control once it happens, but it is relevant to your planning. If you are holding a property with a large unrealized gain and you are in poor health, selling now and paying capital gains tax may not make sense. Holding until death and letting your heirs inherit at stepped-up basis may be the better choice. This is a decision to discuss with an estate planning attorney and a tax professional together.

Investment properties and rental homes: fewer exclusions, more planning needed

The $250,000 primary residence exclusion does not explore to investment properties or homes you rent out. If you own a rental house and sell it for a $100,000 gain, you owe tax on the full $100,000 (minus depreciation recapture, which is taxed at 25%, not the long-term capital gains rate).

For investment properties, your main options are 1031 exchanges, installment sales, or holding until death. A 1031 exchange is the most common choice because it defers the entire tax bill and lets you move your capital into a different property without a tax hit in the year of sale.

If you converted a primary residence to a rental property — for example, you moved out and started renting it — you lose the primary residence exclusion on the gain that accrued after the conversion. You may still be able to exclude gain that accrued while you lived there, but this requires careful calculation and documentation. A tax professional should review the numbers before you sell.

Depreciation recapture: the hidden tax on rental properties

When you own a rental property, you deduct depreciation each year on your tax return. This lowers your taxable income and your tax bill. When you sell, the IRS recaptures that depreciation and taxes it at 25%, not the long-term capital gains rate (0%, 15%, or 20%).

For example, if you owned a rental house for 10 years and deducted $50,000 in depreciation, and you sell the house for a $100,000 gain, you owe tax on $50,000 at the 25% recapture rate (plus tax on the remaining $50,000 at the long-term capital gains rate). This is true even if you use a 1031 exchange — the recapture tax is still due in the year of sale.

Depreciation recapture is not avoidable, but it is predictable. If you have owned a rental property for many years and deducted significant depreciation, factor the 25% recapture tax into your decision about whether to sell. A 1031 exchange still defers the capital gains tax on the appreciation, but not the recapture tax.

Timing the sale: holding period and tax bracket considerations

Capital gains tax depends partly on how long you held the property. If you sell within one year of purchase, the gain is taxed as short-term capital gain, which is taxed at your ordinary income tax rate (up to 37% federally). If you hold for more than one year, it is taxed as long-term capital gain (0%, 15%, or 20%).

The difference is substantial. A $50,000 gain taxed as short-term capital gain at the 37% rate costs $18,500 in federal tax. The same gain taxed as long-term capital gain at the 20% rate costs $10,000. Holding the property one year and one day longer can save thousands in tax.

Your tax bracket also matters. If you are in the 24% ordinary income bracket and you sell a property with a large gain, you may jump into the 32% or 35% bracket. If you can spread the sale across two years (using an installment sale) or defer it (using a 1031 exchange), you may stay in a lower bracket. This is especially relevant if you are near the threshold between the 15% and 20% long-term capital gains rates, which depend on your total taxable income.

Frequently Asked Questions

Can I use the primary residence exclusion if I own the home with someone I am not married to?

Yes, but each owner gets only $250,000, not $500,000. If you and a friend each own half the home and each lived there for two of the last five years, you each exclude $250,000 of your share of the gain. If the total gain is $300,000 and you each own half, you each owe tax on $25,000 of gain.

What happens if I do a 1031 exchange but the replacement property is worth less?

You owe capital gains tax on the difference. If you sell for $500,000 and buy for $400,000, you have $100,000 of boot (taxable proceeds). You defer tax on the $400,000 reinvested, but you owe tax on the $100,000 not reinvested in the year of sale.

Can I do a 1031 exchange on my primary residence?

No. A 1031 exchange requires the property to be held for investment or business use. A primary residence does not may have access to. You must use the primary residence exclusion instead, which is simpler and does not require a may have access to intermediary.

If I inherit a property, do I owe capital gains tax when I sell it?

Not on the appreciation that occurred before you inherited it. You inherit at stepped-up basis, so you owe tax only on any gain between the date of death and the date you sell. If you inherit a home worth $500,000 and sell it three months later for $510,000, you owe tax on only $10,000 of gain.

Does the primary residence exclusion explore if I worked from home?

If you used part of your home as a home office and deducted expenses, the IRS may argue that part of the home was used for business, not as a residence. This can reduce the exclusion proportionally. Consult a tax professional before selling if you have claimed a home office deduction for several years.