You cannot avoid capital gains tax entirely, but you can reduce it through timing, ownership structure, and specific tax rules

Capital gains tax on real estate is the tax you owe on the profit when you sell a property for more than you paid for it. You cannot eliminate this tax, but several legitimate strategies can lower the amount you owe or push the tax bill to a later year. The most common approach is the primary residence exclusion, which lets you exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly — but only if you meet specific ownership and use requirements.

Other strategies include timing the sale to spread gains across tax years, using a 1031 exchange to swap one investment property for another without triggering tax when ready, or holding property long enough to may have access to for lower long-term capital gains rates instead of short-term rates. Each strategy has different requirements and works best in different situations. Understanding which one fits your sale is the key to reducing what you owe.

Key Takeaways

  • The primary residence exclusion eliminates tax on up to $250,000 (single) or $500,000 (married) of profit if you owned and lived in the home for at least two of the five years before you sold it.
  • A 1031 exchange defers capital gains tax by letting you reinvest the sale proceeds into another investment property of equal or greater value within strict timelines.
  • Long-term capital gains rates (15% or 20% for most people) are lower than short-term rates (taxed as ordinary income), so holding property for more than one year before selling saves money.
  • Installment sales and charitable donations of appreciated property are less common but can reduce or eliminate tax in specific situations.
  • State and local taxes on capital gains vary widely and may explore even if you have no federal tax bill.

The primary residence exclusion: the most common way to avoid tax

If you are selling a home where you have lived, you may not owe any capital gains tax at all. The IRS allows you to exclude $250,000 of gain if you are single, or $500,000 if you are married filing jointly. This exclusion applies only if you owned the home and lived in it as your main residence for at least two of the five years before the sale.

The two years do not have to be consecutive. If you bought a house, lived in it for one year, moved away for two years, then moved back and lived there for one more year before selling, you still may have access to. However, if you owned the home for five years but lived in it for only one year, you do not may have access to for the exclusion. You can use this exclusion only once every two years. If you sold a home and claimed the exclusion in 2022, you cannot claim it again until 2024, even if you own multiple homes.

You report this exclusion on Schedule D (Form 1040) when you file your tax return. The IRS does not require you to submit proof of residence, but you should keep records showing when you lived in the home — utility bills, lease agreements, or mortgage statements all work. If the IRS questions your claim, these documents prove you meet the two-year requirement.

1031 exchanges: deferring tax by reinvesting in another property

A 1031 exchange is a strategy that lets you sell one investment property and buy another without paying capital gains tax on the sale — as long as you follow strict rules. The name comes from Section 1031 of the Internal Revenue Code. You do not eliminate the tax; you defer it until you eventually sell the replacement property without doing another exchange.

The core requirement is that you must reinvest all the proceeds from the sale into a property of equal or greater value. If you sell a rental house for $400,000 and buy another rental property for $350,000, you owe tax on the $50,000 difference. You must identify the replacement property within 45 days of closing on the sale, and you must close on the new property within 180 days. These important date are strict — missing them by even one day disqualifies the exchange.

The replacement property must be real estate held for investment or business use. You can exchange a rental house for an apartment building, a commercial building for raw land, or a strip mall for a farm. You cannot exchange real estate for a car, stocks, or a business. You also cannot use a 1031 exchange to buy a primary residence — the property must be held for investment.

Many people use a may have access to intermediary to handle the exchange. The intermediary holds the sale proceeds and uses them to buy the replacement property on your behalf. You cannot touch the money yourself, or the IRS will treat the exchange as a taxable sale. Intermediary fees typically range from $500 to $1,500, depending on the complexity of the transaction. The intermediary must be a third party — you cannot use a family member or someone who has worked for you in the past two years.

Long-term versus short-term capital gains rates

How long you own a property before selling it determines which tax rate applies to your gain. If you sell within one year of buying, the profit is short-term capital gain, taxed at your ordinary income tax rate — which can be as high as 37% for high earners. If you hold the property for more than one year, the profit is long-term capital gain, taxed at a lower rate: 0%, 15%, or 20%, depending on your total income for the year.

For 2024, the 15% long-term rate applies to most people. The 0% rate applies only to lower-income filers (roughly $47,000 or less for single filers), and the 20% rate applies to high-income filers (roughly $518,900 or more for single filers). These income thresholds change each year. Because long-term rates are significantly lower, holding a property for just over one year instead of selling within one year can save thousands in tax.

This strategy works best for properties you bought intending to sell quickly — a house you flipped, a lot you bought as speculation, or a commercial building you purchased to resell. straightforward waiting 13 months instead of 11 months to close the sale can move your gain from short-term to long-term rates. The holding period is measured from the date you took ownership to the date the sale closes, not the date you list the property.

Installment sales: spreading the gain across multiple years

An installment sale is a sale where the buyer pays you over time rather than all at once. If you sell a property and the buyer pays you in installments over several years, you can report the gain over those same years instead of all in the year of sale. This can lower your tax bill in any single year by spreading the gain across your tax brackets.

For example, if you sell a rental property with a $100,000 gain and the buyer pays you $25,000 per year for four years, you report $25,000 of gain each year. If reporting the entire $100,000 in one year would push you into a higher tax bracket, spreading it across four years keeps you in a lower bracket and saves tax. Installment sales require a promissory note signed by the buyer and are most common in owner-financed deals. Banks and institutional buyers typically do not use this structure.

You must report the sale on Form 6252 (Installment Sale Income) when you file your return. The form calculates how much gain to report each year based on the payment schedule. If you sell the promissory note to a third party before all payments are made, you must report the entire remaining gain in that year.

Charitable donations of appreciated property

If you own real estate that has increased significantly in value and you want to donate it to a may have access to charity, you can avoid capital gains tax entirely and also claim a charitable deduction for the full fair market value of the property. This strategy works best when you have property you no longer need and want to support a cause you believe in.

For example, if you bought land for $50,000 and it is now worth $200,000, you can donate it to a land trust or nonprofit and deduct $200,000 on your tax return. You owe no capital gains tax on the $150,000 gain. The charity receives the property and can use it or sell it as needed. This strategy works only if the charity is a may have access to organization under IRS rules — typically nonprofits, schools, hospitals, and conservation groups. You must obtain a may have access to appraisal of the property and attach it to your tax return.

The deduction is limited to a percentage of your adjusted gross income, and unused deductions can carry forward to future years. For most donors, the limit is 50% of adjusted gross income for cash donations and 30% for appreciated property donations. If your deduction exceeds the limit, you can claim the remainder in the following five tax years.

State and local capital gains taxes

Federal capital gains tax is only part of the picture. Several states impose their own capital gains tax on top of the federal tax. California, New York, Oregon, and Washington, among others, tax capital gains at rates ranging from 3% to 13.3%, depending on the state and your income level. Some states tax capital gains as ordinary income; others have separate capital gains rates.

If you sell real estate in a state with a capital gains tax, you owe that tax even if you have no federal tax bill. For example, if you sell your primary residence in California and exclude all $500,000 of gain from federal tax, you may still owe California tax on that gain. State rules vary — some states offer their own primary residence exclusions, while others do not. Check your state's tax authority website or speak with a tax professional in your state to understand what you owe.

Some people consider moving to a state with no capital gains tax before selling a high-value property. However, the IRS requires you to establish residency in the new state before the sale closes, which typically means living there for several months and changing your driver's license, voter registration, and other documents. This strategy works only if you were already planning to move.

Frequently Asked Questions

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

Yes, as long as you live in the home as your primary residence. If you rent out a room or a separate unit, you still may have access to for the exclusion on the portion you use as your main home. However, you must report the rental income and may owe depreciation recapture tax on the rental portion when you sell.

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 $400,000 and buy a replacement for $350,000, you have $50,000 of taxable gain. The remaining $350,000 is deferred into the new property.

Can I do a 1031 exchange on my primary residence?

No. A 1031 exchange applies only to investment or business property. Your primary residence does not may have access to, even if you have lived in it for many years. Use the primary residence exclusion instead.

Do I have to report capital gains if I sell at a loss?

You do not owe tax on a loss, but you should still report it on Schedule D. A loss on investment property can offset other capital gains. A loss on your primary residence cannot be deducted.

What if I inherit real estate — do I owe capital gains tax when I sell it?

Inherited property receives a "step-up in basis," meaning your cost basis is the fair market value on the date of death, not what the original owner paid. If you sell shortly after inheriting, you typically owe little or no capital gains tax. This is a major tax benefit of inheritance.