You cannot avoid capital gains tax entirely, but several legal strategies can reduce what you owe or push the tax bill to a later year

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 taxable income. However, the tax code includes specific exemptions and deferrals that apply to certain situations and certain owners. These are not loopholes — they are written into federal tax law and state tax codes. Understanding which ones apply to your sale requires knowing your filing status, how long you owned the property, and what you do with the proceeds.

The strategies that actually reduce your tax bill fall into two categories: exemptions that eliminate tax on part or all of your gain, and deferrals that move the tax to a future year. Which one works for you depends on whether you are selling a primary residence, investment property, or something else entirely.

Key Takeaways

  • The primary residence exemption lets you exclude up to $250,000 (or $500,000 if married filing jointly) of gain from tax if you owned and lived in the home for at least two of the last five years.
  • A 1031 exchange defers all 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 before selling 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 two other methods that can reduce your immediate tax burden, though each has specific requirements.
  • State capital gains taxes exist in some states and cannot be avoided through federal strategies, so you must research your own state's rules.

The primary residence exemption: up to $250,000 or $500,000 tax-free

If you are selling a home you lived in, you may be able to exclude a portion of your gain from federal tax. The Section 121 exclusion allows you to exclude up to $250,000 of gain if you are single, or up to $500,000 if you are married filing jointly. This is the most common way people avoid capital gains tax on property sales.

To use this exclusion, you must meet two tests. First, you must have owned the property for at least two of the last five years before the sale. Second, you must have lived in it as your primary residence for at least two of the last five years. These do not have to be the same two years, but they must overlap by at least one day. If you owned the home for five years but only lived there for one year, you do not may have access to. If you lived there for two years, moved out, rented it for three years, and then sold it, you still may have access to because you met both the ownership and residence tests within the five-year window.

You can use this exclusion only once every two years. If you sold a home and used the exclusion in 2022, you cannot use it again until 2024. You do not have to file any special form — you simply report the sale on Schedule D (capital gains form) and subtract the exclusion from your taxable gain.

1031 exchanges: deferring all tax by buying another investment property

A 1031 exchange (named after the tax code section) lets you sell investment property and reinvest the proceeds into another investment property without paying capital gains tax at the time of sale. The tax is deferred, not eliminated — you will owe it when you eventually sell the replacement property without doing another exchange. But deferral can be valuable if you want to move your money into a different property or location without a large tax bill interrupting the transaction.

The rules are strict and timing is critical. You must identify a replacement property within 45 days of closing the sale of your original property. You must close on that replacement property within 180 days of the original sale. The replacement property must be of equal or greater value than the property you sold, and it must be held for investment or business use — you cannot exchange into a primary residence. If you sell a rental house for $400,000, you must buy a replacement property worth at least $400,000 within those timelines. If you buy a property worth only $350,000, you will owe tax on the $50,000 difference.

You must use a may have access to intermediary to hold the sale proceeds during the exchange period. You cannot touch the money yourself, or the exchange fails and you owe tax immediately. The intermediary is a neutral third party (often a title company or specialized exchange company) that receives the sale proceeds and disburses them to buy the replacement property. This costs money — typically $500 to $1,500 — but it is required by law.

Long-term capital gains rates: lower tax on property held over one year

How long you own property before selling it affects the tax rate applied to your gain. If you sell property you have owned for one year or less, your gain is taxed as short-term capital gain, which means it is taxed at your ordinary income tax rate — the same rate as wages or salary. If you own it for more than one year, your gain is taxed as long-term capital gain, which has its own lower tax rates.

Long-term capital gains rates are 0%, 15%, or 20% depending on your total income and filing status. For most people, the rate is 15%. Short-term gains are taxed at rates ranging from 10% to 37% depending on your income bracket. The difference can be substantial. If you have $100,000 in short-term gains and you are in the 24% tax bracket, you owe $24,000. The same $100,000 in long-term gains at the 15% rate costs $15,000 — a $9,000 difference.

This is not a strategy you choose; it is automatic based on how long you hold the property. But it means that timing your sale can matter. If you are close to the one-year mark, waiting a few weeks or months can move you from short-term to long-term rates and reduce your tax bill.

Installment sales: spreading the gain (and the tax) over multiple years

An installment sale is when you sell property but the buyer pays you over time in installments rather than all at once. Instead of reporting all your gain in the year of sale, you report it proportionally as you receive payments. This can spread your taxable gain across multiple years, potentially keeping you in a lower tax bracket each year than you would be if all the gain hit in a single year.

For example, if you sell a rental property for $500,000 and your gain is $200,000, you could structure the sale so the buyer pays you $100,000 down and $400,000 over the next four years. You would report $50,000 of gain in the year of sale, and $50,000 in each of the next four years. If spreading the gain this way keeps you in the 15% long-term capital gains bracket instead of pushing you into the 20% bracket, you save money on taxes.

Installment sales require a promissory note from the buyer and are most common in owner-financed transactions. You must report the sale on Form 6252, and you are responsible if the buyer defaults — you do not receive the full sale price. This strategy works best when you trust the buyer or have strong security (like a mortgage on the property itself).

Charitable donations of appreciated property: avoiding tax and getting a deduction

If you own property that has appreciated significantly and you want to donate it to a may have access to charity, you can avoid capital gains tax on the appreciation and also deduct the full fair market value of the property as a charitable contribution. This works for real estate, stocks, and other assets.

For example, if you bought land for $50,000 and it is now worth $200,000, you could sell it and owe capital gains tax on the $150,000 gain. Or you could donate it directly to a may have access to charity. You would owe no capital gains tax, and you could deduct $200,000 as a charitable contribution on your tax return (subject to the limits on charitable deductions, which vary by income and filing status). The charity receives the full $200,000 value, and you receive a tax benefit without triggering a capital gains bill.

The property must go to a may have access to organization — typically a 501(c)(3) nonprofit, a public charity, or a donor-advised fund. You must obtain a may have access to appraisal of the property's value and file Form 8283 with your tax return. This strategy makes sense only if you itemize deductions on your tax return; if you take the standard deduction, the charitable deduction provides no tax benefit.

State capital gains taxes: a separate bill you cannot avoid with federal strategies

Nine states have capital gains taxes separate from income tax: California, Connecticut, Illinois, Maryland, Minnesota, New Jersey, New York, Oregon, and Washington (as of 2024, though this list can change). If you sell property in one of these states or you are a resident of one of these states when you sell property, you owe state capital gains tax in addition to federal tax.

State capital gains tax rates range from about 3% to 13.3% depending on the state and your income. The federal strategies described above — the primary residence exemption, 1031 exchanges, and long-term capital gains rates — apply to federal tax only. Most of these states have their own versions of these rules, but not all, and the details differ. For example, California has a primary residence exemption similar to the federal one, but New York's rules are different. You must research your specific state's rules or consult a tax professional in your state.

Frequently Asked Questions

Can I use the primary residence exemption 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 basement apartment, you still may have access to for the full $250,000 or $500,000 exclusion. However, if you convert the entire home to a rental property and then sell it, you cannot use the exemption — you must have lived there as your primary residence for at least two of the last five years before the sale.

What happens if my gain is larger than the primary residence exemption?

You pay capital gains tax on the amount above the exclusion. If you are single and your gain is $400,000, you exclude $250,000 and owe tax on $150,000. That $150,000 is taxed at long-term capital gains rates (0%, 15%, or 20%) if you owned the home for more than one year. You do not owe tax on the full $400,000 — only the portion above the exclusion.

Can I do a 1031 exchange with my primary residence?

No. A 1031 exchange requires the property to be held for investment or business use. Your primary residence does not may have access to. If you want to sell your home and buy another home without a large tax bill, use the primary residence exemption instead.

Do I have to report a property sale to the IRS if my gain is below the exemption?

You must report the sale on Schedule D even if your gain is zero or negative (a loss). The IRS receives a copy of the closing statement from your title company, so they know you sold the property. Reporting it correctly, even if you owe no tax, keeps your records clear and prevents IRS inquiries later.

What if I inherited the property — does that change the capital gains tax?

Yes, significantly. Inherited property receives a "step-up in basis," which means your cost basis is reset to the property's fair market value on the date of the person's death. If your parent bought a house for $100,000 and it is worth $400,000 when they die, your basis is $400,000. If you sell it immediately for $400,000, you have zero gain and owe no capital gains tax. This is one of the largest tax benefits in the code and applies to most inherited property.