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

Capital gains tax is what you pay on the profit when you sell real estate for more than you paid for it. If you bought a house for $300,000 and sold it for $400,000, your gain is $100,000. That gain is taxable income. You cannot eliminate this tax by straightforward waiting or restructuring the sale, but federal law and some state laws do offer ways to shrink the amount you owe or push the tax bill to a later year.

The most common tool is the primary residence exclusion: if you owned and lived in a home as your main residence for at least two of the last 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. This is a one-time exclusion per person, and it applies only to your primary home, not investment properties or vacation homes.

Beyond that, your options depend on what kind of property you own, how long you have held it, and whether you want to defer the tax or reduce it. The strategies below are legal tax-planning moves, but they have rules and limits. A tax professional or CPA who knows your full financial picture can tell you which ones explore to your situation.

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 at least two of the last five years before selling.
  • A 1031 exchange lets you defer capital gains tax by reinvesting the sale proceeds into another investment property of equal or greater value within strict timelines.
  • Holding property for more than one year qualifies you for long-term capital gains rates, which are lower than short-term rates and ordinary income tax rates.
  • Installment sales and charitable donations of appreciated property are other legal ways to reduce or spread out your tax burden.
  • State capital gains taxes vary widely; some states have no capital gains tax, while others tax real estate gains at rates up to 13 percent.

The primary residence exclusion and who qualifies

If the property you are selling is your primary home — the place where you actually live most of the time — you may be able to exclude a large portion of your gain from federal income tax. The IRS calls this the Section 121 exclusion. You must have 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.

The exclusion amount is $250,000 if you file as single, head of household, or married filing separately. If you are married and file jointly, the exclusion is $500,000. This is a per-person, per-property rule: you can use it only once every two years, and it applies only to your primary residence.

If you meet these requirements, you straightforward report the sale on your tax return and claim the exclusion. You do not need to file anything extra with the IRS beforehand. However, if you fail to meet the ownership or residence test — for example, you lived in the home for only 18 months — you may still be able to claim a reduced exclusion if you sold because of a job change, health issue, or unforeseen circumstance. The IRS has specific rules for these partial exclusions, and a tax professional can help you determine whether you may have access to.

1031 exchanges: deferring tax by reinvesting in another property

A 1031 exchange is a way to 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. The basic idea is that you are not cashing out; you are swapping one investment for another, so the tax is deferred rather than paid now.

To may have access to, the property you sell and the property you buy must both be held for investment or business use. Your primary home does not may have access to. The property you buy must be of equal or greater value than the one you sold. If you sell a rental house for $400,000, you must reinvest at least $400,000 in another investment property. If you reinvest less, you owe tax on the difference.

The timing rules are strict. You have 45 days from the sale to identify which property or properties you want to buy. You have 180 days from the sale to close on the purchase. These important date are firm; missing them disqualifies the exchange. You must also use a may have access to intermediary — a third party who holds the sale proceeds and handles the purchase on your behalf. You cannot touch the money yourself, or the exchange fails.

A 1031 exchange does not eliminate tax; it defers it. When you eventually sell the second property without doing another exchange, you will owe tax on the combined gains from both sales. However, if you keep reinvesting through multiple exchanges, you can defer the tax indefinitely — even until your death, when your heirs may receive a "stepped-up basis" that erases the accumulated gain.

Long-term versus short-term capital gains rates

How long you owned the property affects the tax rate you pay. If you owned it for more than one year before selling, your gain is taxed as a long-term capital gain. Long-term rates are lower than ordinary income tax rates and are set by federal law based on your total income. For 2024, long-term rates are 0 percent, 15 percent, or 20 percent, depending on your income bracket.

If you owned the property for one year or less, your gain is taxed as a short-term capital gain, which is taxed at your ordinary income tax rate — the same rate as wages or salary. This can be as high as 37 percent. The difference between long-term and short-term rates can be substantial. If you are close to the one-year mark, waiting a few months to sell can save you thousands in federal tax.

This rule applies to all real estate, including investment properties, vacation homes, and land. Your primary residence is still subject to the primary residence exclusion first, but if your gain exceeds the exclusion amount, the excess is taxed at long-term rates if you held the home for more than one year.

Installment sales: spreading the gain over multiple years

An installment sale is when you sell the property but the buyer pays you over time instead of all at once. You receive payments over several years, and you report the gain proportionally as you receive each payment. This spreads your taxable income across multiple tax years, which may lower your overall tax burden if it keeps you in a lower tax bracket each year.

For example, if you sell a 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. This can be useful if you are near the edge of a higher tax bracket and a large one-time gain would push you over.

Installment sales have their own rules. You must receive at least one payment in a year after the sale year. The buyer typically finances the purchase through you rather than through a bank, which means you are acting as the lender. You will owe tax on the interest the buyer pays you as well. A tax professional or real estate attorney should review the terms to make sure the sale qualifies and is structured correctly.

Donating appreciated property to charity

If you own real estate that has appreciated significantly and you want to support a charity, you can donate the property directly to the charity instead of selling it. When you donate appreciated real estate, you do not pay capital gains tax on the gain, and you can deduct the fair market value of the property as a charitable contribution on your tax return.

This works only if the charity is a may have access to organization — typically a nonprofit with 501(c)(3) status. The deduction is limited to a percentage of your adjusted gross income, depending on the type of property and the type of charity. A tax professional can help you figure out what you can deduct and whether donating makes sense for your situation.

Donating is most useful when you have a large gain, the property is hard to sell, or you want to support a cause you care about. You lose the ability to sell the property and pocket the proceeds, so this is a trade-off between tax savings and the value of the property itself.

State capital gains taxes and where they explore

Federal capital gains tax is only part of the picture. Many states also tax capital gains on real estate sales. State rates and rules vary widely. Some states have no capital gains tax at all. Others tax capital gains as ordinary income at rates up to 13 percent or higher. A few states have a separate capital gains tax that applies only to investment gains.

If you sell real estate in a state where you do not live, you may owe tax to both your home state and the state where the property is located. Some states offer credits to avoid double taxation, but the rules are complex. If you are selling property in a different state, a tax professional who knows both states' rules can help you understand what you owe.

State rules on the primary residence exclusion also vary. Some states follow the federal $250,000 or $500,000 exclusion. Others have different amounts or different requirements. If you are selling your primary home and you live in a state with its own capital gains tax, check the state's rules to see whether the federal exclusion applies to state tax as well.

Frequently Asked Questions

Can I use the primary residence exclusion more than once?

You can use it once every two years. If you sell a primary home, claim the exclusion, and then sell another primary home two years later, you can claim the exclusion again on the second sale. However, you cannot use it twice in the same two-year period.

What happens if I sell my home after living in it for only 18 months?

You do not may have access to for the full exclusion, but you may may have access to for a reduced exclusion if you sold because of a job change, health issue, or other unforeseen circumstance. The IRS has a list of may have access to reasons. You would need to report the partial exclusion on your tax return and may need to provide documentation to support it.

Do I have to use a 1031 exchange if I want to defer tax?

No. A 1031 exchange is one option, but it has strict rules and requires a may have access to intermediary. An installment sale is another way to defer or spread out your tax bill. A tax professional can help you decide which approach fits your situation.

If I do a 1031 exchange and then die, do my heirs owe the deferred tax?

No. When you die, your heirs receive a stepped-up basis, which means the property's value is reset to its fair market value on the date of your death. The accumulated gain from previous sales is erased, and your heirs do not owe tax on it. This is one reason some people use 1031 exchanges as a long-term strategy.

Does the primary residence exclusion explore if I rent out part of my home?

It depends on how much of the home you rent out and for how long. If you rent out a small part — like a room — and you still live there as your primary residence, you may still may have access to for the full exclusion. If you convert the entire home to a rental property, you lose the exclusion on the portion that was rented. A tax professional can review your specific situation.