The main ways to reduce capital gains tax on real estate

You cannot avoid capital gains tax entirely when you sell real estate at a profit, but you can reduce what you owe through three concrete strategies: the primary residence exclusion, tax-loss harvesting in the same year, and deferral through a 1031 exchange. The primary residence exclusion is the most common—if you owned and lived in the home as your main residence for at least two of the five years before the sale, you can exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly. The other two strategies require more planning but can defer or offset gains in specific situations.

Capital gains tax applies to the profit you make, not the sale price. If you bought a house for $300,000 and sold it for $500,000, your gain is $200,000. Federal tax on that gain ranges from 0% to 20% depending on your total income that year, plus you may owe state tax and a 3.8% net investment income tax if your income exceeds certain thresholds. The strategies below reduce the taxable gain itself, not the rate you pay on it.

Key Takeaways

  • The primary residence exclusion lets you exclude up to $250,000 (single) or $500,000 (married) of gain if you lived in the home for two of the last five years before selling.
  • A 1031 exchange defers capital gains tax by reinvesting the sale proceeds into another investment property within strict timelines: 45 days to identify, 180 days to close.
  • You can offset gains in the same year by selling other investments at a loss, a strategy called tax-loss harvesting.
  • Inherited property receives a "step-up in basis," meaning your cost basis becomes the property's value on the date of death, not what the original owner paid.
  • State capital gains taxes vary widely; some states have no capital gains tax on real estate, while others tax it as ordinary income.

Using the primary residence exclusion

The primary residence exclusion is a federal tax break that applies automatically when you meet the ownership and use test. You must have owned the property and lived in it as your main home for at least two of the five years before the sale. The two years do not have to be consecutive, and they do not have to be the most recent two years. If you owned the house for ten years but only lived in it for two of those years, you still may have access to.

The exclusion amount is $250,000 for single filers and $500,000 for married couples filing jointly. Both spouses must meet the ownership and use test separately—you cannot combine one spouse's two years with the other's. If only one spouse meets the test, the exclusion is $250,000. You can use this exclusion once every two years, so if you sold a home in 2022 and used the exclusion, you cannot use it again until 2024.

You report the exclusion on Schedule D (Form 1040) when you file your tax return. You do not need to do anything special when you sell—the exclusion is not claimed at closing. The title company or real estate agent will not ask about it. You claim it when you file taxes for the year of the sale.

Deferring gains through a 1031 exchange

A 1031 exchange is a strategy that defers capital gains tax by reinvesting the sale proceeds into another investment property. The name comes from Section 1031 of the Internal Revenue Code. The tax is not eliminated—it is postponed until you eventually sell the replacement property without doing another exchange. This works only for investment or business property, not for your primary residence.

The timeline is strict and non-negotiable. You have 45 days from the closing date of the sale to identify the replacement property in writing. You have 180 days from closing to complete the purchase of the replacement property. These are calendar days, not business days, and weekends and holidays count. If you miss either deadline, the exchange fails and you owe capital gains tax on the original sale.

You must use a may have access to intermediary—a third party who holds the sale proceeds and coordinates the purchase of the replacement property. You cannot touch the money yourself, even briefly. If you receive the funds directly, the exchange is disqualified. The intermediary charges a fee, typically $500 to $1,500, depending on the complexity of the transaction. You can find may have access to intermediaries through the Federation of Exchange Accommodators or by asking your tax professional for a referral.

The replacement property must be of equal or greater value than the property you sold, and it must be real estate held for investment or business use. You can exchange a rental house for an apartment building, or commercial property for raw land. You cannot exchange real estate for personal property like a vehicle or equipment. If the replacement property costs less than the sale price, you owe capital gains tax on the difference.

Offsetting gains with losses in the same year

You can reduce capital gains from real estate by selling other investments at a loss in the same tax year. This is called tax-loss harvesting. If you sold a rental property for a $100,000 gain and also sold stocks for a $40,000 loss, your net capital gain for the year is $60,000, and you pay tax only on that amount.

Capital losses can offset capital gains dollar-for-dollar. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against ordinary income (like wages or business income) in that year. Any remaining loss carries forward to future years and can offset future gains or ordinary income, again at $3,000 per year.

This strategy requires you to own other investments and to have losses available to harvest. It is most useful if you already hold a diversified portfolio and have underperforming positions. You cannot create artificial losses by selling property to a related party and buying it back—the IRS has rules against wash sales and related-party transactions that prevent this.

Understanding the step-up in basis for inherited property

If you inherit real estate, your cost basis is stepped up to the property's fair market value on the date of the original owner's death. This is a major tax advantage. If your parent bought a house for $100,000 and it was worth $400,000 when they died, your basis becomes $400,000. If you sell it a year later for $410,000, your gain is only $10,000, not $310,000.

The step-up applies to the entire property value at death, regardless of how long the original owner held it or how much they paid. You do not need to do anything to claim it—it is automatic. You report the stepped-up basis as your cost basis when you eventually sell the property.

This benefit does not apply to property you receive as a gift during someone's lifetime. If your parent gives you a house while they are alive, your basis is their original cost basis, not the current value. The step-up only happens at death.

State capital gains taxes and variations by location

Federal capital gains tax is only part of the picture. Many states also tax capital gains, and the rates and rules vary significantly. Nine states have no income tax at all: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming. If you live in one of these states, you owe no state capital gains tax on real estate sales.

Other states tax capital gains as ordinary income, meaning your capital gain is added to your other income and taxed at your marginal rate. California, for example, taxes capital gains as ordinary income with rates up to 13.3%. Some states have separate capital gains tax rates. Washington and Oregon have capital gains taxes that apply only to long-term gains above a certain threshold.

If you are considering moving before or after a real estate sale, the state tax difference can be substantial. A $200,000 gain taxed at 13.3% in California costs $26,600 in state tax alone. The same gain in Florida costs zero. This is a legitimate tax planning consideration, but you must actually move and establish residency—you cannot claim residency in a no-tax state if you continue to live elsewhere.

Timing the sale and holding period considerations

The length of time you hold a property affects your federal tax rate but not whether you owe tax. If you hold the property for more than one year before selling, any gain is taxed as a long-term capital gain. Long-term rates are 0%, 15%, or 20% depending on your income. If you sell within one year, the gain is taxed as a short-term capital gain at your ordinary income tax rate, which can be as high as 37%.

This means holding a property just over one year can save you significant tax. If you bought a property for $300,000 and sold it for $400,000 after 11 months, your $100,000 gain might be taxed at 37% (short-term), costing $37,000. If you waited one month and sold after 13 months, the same gain would be taxed at 15% or 20% (long-term), costing $15,000 to $20,000.

However, holding a property longer does not reduce the gain itself—it only changes the tax rate. If you hold a property for 30 years and it appreciates significantly, you will owe tax on the entire appreciation when you sell, unless you use one of the strategies above.

Frequently Asked Questions

Can I use the primary residence exclusion if I rented out part of my home?

Yes, as long as you lived in the home as your main residence for at least two of the five years before the sale. However, you must pay capital gains tax on the portion of the gain that relates to the rental part. If you rented out 20% of the home, you exclude 80% of the gain and pay tax on 20% of it.

What happens if I sell a rental property and buy a new one within a few months but do not do a 1031 exchange?

You owe capital gains tax on the sale in the year you sell, regardless of whether you buy another property. Simply purchasing a replacement property does not defer tax. You must use a may have access to intermediary and follow the 45-day and 180-day timelines for a 1031 exchange to defer the tax.

Do I have to report the sale to the IRS even if my gain is below the primary residence exclusion?

Yes. You report the sale on Schedule D (Form 1040) even if the gain is fully excluded. The IRS wants to see the transaction and verify that you meet the ownership and use test. Failing to report it can trigger an audit.

Can I do a 1031 exchange with my spouse's property?

Each person must do their own 1031 exchange. If you and your spouse own a rental property together and want to defer tax, you each need a separate may have access to intermediary and separate replacement properties, or you can both exchange into the same replacement property but document each person's exchange separately.

What if I inherited a property and then sold it within a year—do I owe capital gains tax?

You owe tax only on the gain above the stepped-up basis value at the date of death. If the property was worth $400,000 when inherited and you sold it for $410,000, your gain is $10,000 and you owe tax on that. The holding period does not matter for inherited property—the step-up in basis is the primary tax benefit.