You cannot avoid capital gains tax entirely, but several legal strategies can reduce what you owe or delay payment

When you sell a property for more than you paid for it, the profit is taxable income. The IRS calls this a capital gain. You cannot eliminate the tax, but you can lower it through specific methods: holding the property long enough to may have access to for lower tax rates, using the primary residence exclusion, doing a 1031 exchange to defer gains, or offsetting gains with losses from other investments. Which strategy works depends on how long you owned the property, whether it was your home, and your overall tax situation.

Key Takeaways

  • Long-term capital gains (property held over one year) are taxed at 0%, 15%, or 20% depending on income, while short-term gains use your ordinary income tax rate, which is usually higher.
  • If you lived in the home as your primary residence for at least two of the last five years, you can exclude up to $250,000 in gains (or $500,000 if married filing jointly) from federal tax.
  • A 1031 exchange lets you reinvest the sale proceeds into another property and defer all capital gains tax, though you must identify and close on the new property within strict IRS timelines.
  • Capital losses from other investments or prior years can offset capital gains dollar-for-dollar, reducing your taxable gain.
  • State capital gains taxes exist in some states and cannot be avoided through these federal strategies; you must check your state's rules separately.

How long you held the property determines your tax rate

The IRS taxes capital gains at two different rates depending on how long you owned the property. If you held it for one year or less, it is a short-term capital gain and is taxed as ordinary income — meaning you pay your regular income tax rate, which can be 10%, 12%, 22%, 24%, 32%, 35%, or 37% depending on your total income.

If you held the property for more than one year, it is a long-term capital gain and receives preferential rates: 0%, 15%, or 20%. Which rate applies depends on your taxable income and filing status. For 2024, a single filer with taxable income under $47,025 pays 0% on long-term gains; between $47,025 and $518,900 pays 15%; above that pays 20%. These income thresholds change yearly. The difference is substantial: a $100,000 gain taxed at 37% (short-term) costs $37,000, while the same gain at 15% (long-term) costs $15,000.

The simplest way to reduce your tax is to hold the property longer than one year before selling. If you are considering selling soon, waiting a few months to cross the one-year threshold can save thousands in federal tax.

The primary residence exclusion eliminates tax on most home sales

If you sold your main home, you may not owe any capital gains tax at all. The IRS allows you to exclude up to $250,000 in gains if you are single, or $500,000 if you are married filing jointly. To use this exclusion, you must have owned the home and lived in it as your primary residence for at least two of the five years before the sale.

Example: You bought a house for $300,000, lived in it for three years, and sold it for $450,000. Your gain is $150,000. Because you lived there more than two of the last five years and are single, you exclude the entire $150,000 — you owe zero federal capital gains tax. If you were married filing jointly, you could exclude up to $500,000, so a gain of $200,000 would still be tax-free.

You can use this exclusion once every two years. If you sold a home and used the exclusion, you must wait at least two years before using it again on another property. Rental properties, investment properties, and vacation homes do not may have access to — only your primary residence counts.

A 1031 exchange defers all capital gains tax by reinvesting the proceeds

A 1031 exchange (named after Section 1031 of the tax code) lets you sell a property and reinvest the proceeds into another property without paying capital gains tax. The tax is not eliminated — it is deferred until you eventually sell the second property without doing another exchange. This strategy is useful if you want to move your money into a different property but do not want to trigger a large tax bill immediately.

The rules are strict. You must identify a replacement property within 45 days of closing on the sale. 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 (rental properties, commercial buildings, and vacant land all may have access to; your primary residence does not). You cannot touch the sale proceeds yourself — a may have access to intermediary (a neutral third party) must hold the money and transfer it directly to the seller of the replacement property.

Example: You sell a rental house for $400,000 and owe $100,000 in capital gains tax. Instead of paying that tax, you use a 1031 exchange to buy a $400,000 apartment building. You owe zero tax now. If you later sell the apartment building for $500,000 without doing another exchange, you will owe tax on the combined gain from both properties.

Capital losses offset capital gains dollar-for-dollar

If you have losses from selling other investments or property, you can use those losses to reduce your capital gains. A loss on one investment cancels out a gain on another, dollar-for-dollar. If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against ordinary income, and carry forward any remaining loss to future years.

Example: You sell a rental property for a $50,000 gain. You also sold stocks at a $20,000 loss. Your net capital gain is $30,000, and you pay tax only on that amount. If your stock loss was $60,000 instead, you would have a $10,000 net loss. You could deduct $3,000 against your ordinary income this year and carry forward the remaining $7,000 to reduce gains or income in future years.

This strategy requires tracking your investment activity across all accounts. Many people do not realize they have losses available because they sold investments years ago. If you are planning a large property sale, review your investment history with a tax professional to see whether you have unused losses to apply.

State capital gains taxes apply separately and cannot be deferred

Nine states have a capital gains tax in addition to federal tax: California, Connecticut, Illinois, Maryland, Minnesota, New Jersey, New York, Oregon, and Washington. (Washington's tax applies only to long-term gains over $250,000.) These state taxes cannot be avoided through 1031 exchanges or other federal strategies — they apply whenever you sell property at a gain, regardless of how long you held it.

State capital gains tax rates range from 3.8% to 13.3% depending on the state and your income. If you live in California and sell a property with a $100,000 gain, you will owe California state tax on top of federal tax. If you live in a state with no capital gains tax (such as Texas, Florida, or Nevada), you only owe federal tax. If you are moving out of state after a sale, check whether your new state taxes gains from property sold while you were a resident of the old state — some states do.

Timing the sale and your income can lower your tax bracket

Because long-term capital gains are taxed based on your total taxable income, you can sometimes reduce your rate by controlling when you sell. If you are near the edge of a tax bracket, selling in a year when your other income is lower might keep you in a lower capital gains bracket.

Example: You are single with $40,000 in ordinary income. The 15% long-term capital gains rate starts at $47,025 of taxable income. If you sell a property with a $10,000 gain, your total income is $50,000, and $2,975 of the gain is taxed at 15% while $7,025 is taxed at 0%. If you could delay the sale one year and have only $30,000 in ordinary income, the entire $10,000 gain would be taxed at 0%. This works only if you have control over when you sell and can predict your income for the year.

Retirees sometimes use this strategy by timing property sales in years when they have lower income, or by spreading sales across multiple years to stay in lower brackets. This requires planning with a tax professional and works best when you have flexibility on the sale date.

Frequently Asked Questions

Do I owe capital gains tax if I inherited a property and then sold it?

No, not on the gain that occurred before you inherited it. Inherited property receives a "step-up in basis," meaning the IRS values it at its fair market value on the date of death. If you inherited a house worth $300,000 and sold it for $310,000 three months later, you owe tax only on the $10,000 gain that occurred after you inherited it, not on any gain from when the original owner bought it.

Can I use the primary residence exclusion on a second home or vacation property?

No. The exclusion applies only to your primary residence — the home where you lived for at least two of the five years before the sale. Second homes, vacation properties, and rental properties do not may have access to, even if you lived in them part-time. Those sales are subject to full capital gains tax unless you use a 1031 exchange.

What happens if I sell a rental property at a loss?

You can use the loss to offset capital gains from other investments or sales. If you have no other gains, you can deduct up to $3,000 of the loss against ordinary income in that year, and carry forward any excess loss to future years. Keep records of the original purchase price, sale price, and date of sale to document the loss.

If I do a 1031 exchange, do I ever have to pay the tax?

Yes, eventually. The tax is deferred, not eliminated. When you sell the replacement property, you owe tax on the combined gain from both properties unless you do another 1031 exchange. You can chain multiple exchanges together indefinitely, but the moment you sell without exchanging, the accumulated tax becomes due.

Does gifting a property to a family member avoid capital gains tax?

Gifting avoids capital gains tax for you, but the recipient receives the same basis you had. If you bought a house for $200,000 and gift it when it is worth $400,000, the recipient's basis is still $200,000. If they later sell it for $450,000, they owe tax on the $250,000 gain. Inheriting is different — inherited property gets a step-up in basis, so the recipient would owe tax only on gains after the inheritance date.