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

Capital gains tax on property is owed when you sell real estate for more than you paid for it. The difference between your purchase price (plus improvements) and your sale price is your gain, and that gain is taxable income. You cannot eliminate this tax, but the law provides several legitimate ways to shrink the amount you owe or push the tax bill into a later year.

The most common method is the primary residence exclusion: if you owned and lived in a home as your main residence for at least two of the five years before you sold it, you can exclude up to $250,000 of gain from tax (or $500,000 if you are married filing jointly). This is not a deferral — the gain straightforward does not count as income. Other strategies involve timing the sale, using a 1031 exchange to swap one property for another, holding property until death, or structuring ownership through a business entity. Each has different rules and different tax consequences.

Key Takeaways

  • The primary residence exclusion lets you exclude up to $250,000 of gain ($500,000 if married) if you lived in the home for two of the last five years before selling.
  • A 1031 exchange lets you defer capital gains tax by selling one investment property and buying another of equal or greater value within strict timelines.
  • Holding property until you die can eliminate the capital gains tax entirely for your heirs, because they receive a "stepped-up basis" at your death.
  • Timing your sale across two tax years, donating appreciated property to charity, or holding property longer to may have access to for lower long-term rates can reduce your tax bill.
  • Investment property and vacation homes do not may have access to for the primary residence exclusion and have fewer options to reduce tax.

The primary residence exclusion: the biggest tax break for homeowners

If you sell your main home, you can exclude up to $250,000 of capital gain from your taxable income 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 primary residence for at least two of the five years before the sale. The two years do not have to be consecutive, and you can use this exclusion once every two years.

Example: You bought a house for $300,000, lived in it for three years, then sold it for $550,000. Your gain is $250,000. If you are single, you exclude the full $250,000, so you owe no capital gains tax. If you are married filing jointly, you exclude the full $250,000 and owe nothing. If your gain had been $600,000, a single filer would owe tax on $350,000 of gain, while a married couple would owe tax on $100,000.

You must report the sale on your tax return even if your gain falls entirely within the exclusion. The exclusion is not automatic — you claim it when you file. If you do not meet the ownership and residence test, you cannot use it, and you will owe tax on the full gain.

1031 exchanges: deferring tax by swapping investment properties

A 1031 exchange (named after Section 1031 of the Internal Revenue Code) lets you sell one investment property and buy another without paying capital gains tax on the sale — as long as you follow strict rules. You do not avoid the tax forever; you defer it until you eventually sell the replacement property without doing another exchange. This strategy works only for investment or business property, not for your primary residence.

The rules are rigid. You must identify a replacement property within 45 days of selling your original property, and you must close on the new property within 180 days of the sale. You cannot touch the money from the sale yourself; it must go to a may have access to intermediary (a third party licensed to hold the funds). The replacement property must be of equal or greater value than the property you sold, and it must be "like-kind" — which for real estate means any real property used in business or held for investment (a rental house, commercial building, or vacant land all count as like-kind to each other).

If you sell a rental property for $500,000 and buy another rental property for $500,000 or more within the timelines using a may have access to intermediary, you owe no capital gains tax on the sale. If you buy a replacement property worth only $400,000, you owe tax on the $100,000 difference. If you miss the 45-day identification important date or the 180-day closing important date, the exchange fails and you owe tax on the full gain.

Holding property until death: the stepped-up basis

When you die, your heirs inherit your property at its fair market value on the date of your death. This is called a stepped-up basis. If you bought a rental house for $200,000 and it is worth $500,000 when you die, your heirs inherit it with a basis of $500,000. If they sell it when ready for $500,000, they owe no capital gains tax because their gain is zero.

This is the only way to eliminate capital gains tax entirely on appreciated property. You do not pay the tax, and your heirs do not pay it either. The trade-off is that you must hold the property until death, which means you cannot access the gain during your lifetime. This strategy makes sense only if you do not need to sell the property and you want to pass it to heirs.

The stepped-up basis applies to all property in your estate, not just real estate. It does not explore to retirement accounts like IRAs or 401(k)s, which have their own tax rules. If you own property jointly with a spouse, only the deceased spouse's share receives a stepped-up basis; the surviving spouse's share keeps its original basis.

Timing strategies: spreading gains across years or holding longer

Capital gains are taxed at different rates depending on how long you held the property. Long-term capital gains (property held more than one year) are taxed at 0%, 15%, or 20% depending on your income. Short-term capital gains (property held one year or less) are taxed as ordinary income, which can be as high as 37%. If you are close to the one-year mark, waiting a few months can cut your tax rate significantly.

If you sell property in a year when your income is unusually high (from a bonus, inheritance, or business sale), you may pay tax at a higher rate. Delaying the sale until the next year, when your income is lower, can reduce your tax bill. This works only if you control the timing of the sale and if your income genuinely drops in the following year.

You can also split a sale across two calendar years in some cases. If you own raw land and sell it on a contract for deed (the buyer pays you over time rather than in a lump sum), you can report the gain over multiple years as you receive payments. This spreads the income across years and may keep you in a lower tax bracket.

Donating appreciated property to charity

If you donate appreciated real estate to a may have access to charity, you avoid capital gains tax on the appreciation and you can deduct the fair market value of the property as a charitable contribution on your tax return. You must itemize deductions for this to benefit you (it only helps if your total itemized deductions exceed the standard deduction).

Example: You own a vacant lot you bought for $100,000 that is now worth $300,000. If you sell it, you owe capital gains tax on the $200,000 gain. If you donate it to a land trust or other may have access to charity, you owe no capital gains tax and you can deduct $300,000 as a charitable contribution (subject to limits based on your income). The charity must be a may have access to organization under IRS rules; donating to a private individual or non-may have access to organization does not work.

This strategy works best if you have a large gain, you itemize deductions, and you want to support a cause. It is permanent — you cannot get the property back — so it only makes sense if you were planning to sell anyway.

Ownership structure: holding property through a business entity

Some people hold investment property through a limited liability company (LLC), S corporation, or partnership instead of in their own name. This does not reduce capital gains tax on the sale itself, but it can offer other tax benefits and liability protection. The capital gains tax is still owed when the property is sold, whether you own it personally or through an entity.

In some cases, holding property through an entity can help you use losses from other business activities to offset the gain, or it can allow you to spread the gain among multiple owners (in a partnership, each partner reports their share of the gain). These strategies are complex and depend on your overall tax situation. You should discuss entity structure with a tax professional before buying property, because changing the structure later can trigger tax consequences.

What does not work: common misconceptions

You cannot avoid capital gains tax by reinvesting the proceeds into another property (unless you use a 1031 exchange with the strict rules described above). straightforward buying a new house does not defer or eliminate tax on the sale of the old one.

You cannot avoid capital gains tax by renting out your home after you sell it, or by claiming it is now an investment property. The tax is owed in the year you sell, based on the use of the property before the sale.

You cannot reduce capital gains tax by paying it in installments or setting up a payment plan. The tax is still owed in full in the year of the sale; a payment plan is just a way to pay what you already owe.

If you inherit property and then sell it, you owe capital gains tax only on any appreciation that occurs after you inherit it, not on the appreciation before death (because of the stepped-up basis). However, if you inherited the property years ago and it has appreciated since then, you will owe tax on that new appreciation.

Frequently Asked Questions

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

If you rent out part of your home, you can still use the exclusion on the portion you lived in, but not on the rental portion. You will owe capital gains tax on the gain attributable to the rental part. You must allocate the gain between the personal-use and rental portions based on the square footage or the time you rented it out.

What if I sell my home at a loss?

You cannot deduct a loss on the sale of your primary residence. If you bought a house for $400,000 and sold it for $350,000, you have a $50,000 loss, but you cannot use it to reduce other income. Losses on investment property can sometimes be deducted, but the rules are different and more complex.

Do I owe capital gains tax if I sell property to a family member?

Yes. The price you charge does not matter — if the fair market value of the property is higher than your basis, you owe capital gains tax on the difference. Selling to a family member at a discount does not reduce your tax; it just means the family member paid less than the property is worth. You still report the gain based on fair market value.

Can I use a 1031 exchange to buy a primary residence?

No. A 1031 exchange works only for investment or business property. If you sell a rental property and want to buy a home to live in, you cannot use a 1031 exchange, and you will owe capital gains tax on the sale of the rental property.

What if I inherited property and want to sell it soon after?

You inherit the property at its fair market value on the date of death (stepped-up basis). If you sell it shortly after inheriting it for approximately the same price, you owe little or no capital gains tax. If the property appreciates between the date of death and the date of sale, you owe tax on that new appreciation.