How capital gains tax works on property sales

When you sell property for more than you paid for it, the profit is called a capital gain, and the IRS taxes it. The tax rate depends on how long you owned the property: if you held it for more than one year, it's taxed as a long-term capital gain (usually 0%, 15%, or 20% depending on your income). If you sold it within one year, it's taxed as ordinary income, which is higher.

The key to reducing what you owe is understanding which gains the tax code actually exempts or defers, and which strategies let you spread the tax across multiple years instead of paying it all at once. Some of these are available to almost any homeowner; others require specific circumstances or advance planning.

Key Takeaways

  • The primary residence exclusion lets you exclude up to $250,000 of gain ($500,000 if married filing jointly) if you owned and lived in the home for at least two of the last five years before selling.
  • A 1031 exchange defers capital gains tax indefinitely by reinvesting the sale proceeds into another property of equal or greater value within strict timelines.
  • Installment sales let you spread the gain across multiple tax years, potentially keeping you in a lower tax bracket each year.
  • Holding property longer than one year qualifies the gain for lower long-term capital gains rates instead of ordinary income tax rates.
  • Charitable donations of appreciated property and opportunity zone investments are specialized strategies that require planning before you sell.

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

If the property you're selling is your main home, you can exclude up to $250,000 of the gain from taxation if you're single, or $500,000 if you're married filing jointly. This is the primary residence exclusion, and it's the reason most homeowners pay little or no capital gains tax when they sell.

To use it, 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. The two years don't have to be consecutive. If you meet this test, you straightforward don't report the excluded portion of the gain on your tax return—it disappears.

This exclusion is available once every two years per person. If you're married and both spouses meet the ownership and residence test, you can each claim the exclusion, doubling it to $500,000 total. If your gain exceeds the exclusion amount, you owe tax only on the excess.

1031 exchanges: deferring tax by reinvesting in another property

A 1031 exchange (named after the tax code section) lets you sell a property and reinvest all the proceeds into another property without paying capital gains tax at that moment. The tax is deferred, not erased—you'll owe it when you eventually sell the replacement property, unless you do another 1031 exchange then.

The rules are strict. You must identify a replacement property within 45 days of closing on the sale, and you must close on it within 180 days. The replacement property must be of equal or greater value, and it must be held for investment or business use (your primary home doesn't may have access to). You cannot touch the sale proceeds yourself; a may have access to intermediary must hold the money and transfer it directly to the seller of the replacement property.

1031 exchanges work for rental properties, vacant land, commercial buildings, and other investment real estate. Many investors use them repeatedly to build a portfolio without triggering tax bills until they finally cash out or donate the property to charity.

Installment sales: spreading the gain across multiple years

An installment sale is when you sell the property but the buyer pays you over time instead of all at once. You report the gain proportionally across the years you receive payments, which can keep you in a lower tax bracket each year instead of pushing you into a higher one in the year of sale.

For example, if you have 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 your other income is lower in some of those years, you may pay less total tax than if you'd reported the entire $100,000 in one year.

Installment sales require a promissory note and mortgage or deed of trust securing the buyer's obligation to pay. You'll need a real estate attorney to structure it correctly. The buyer must be creditworthy, and you're taking on the risk that they'll default. This strategy works best when you're selling to a buyer you trust or when the property is difficult to finance through a traditional lender.

Holding the property long enough to may have access to for lower tax rates

If you own property for more than one year before selling, your gain is taxed as a long-term capital gain. The federal tax rate is 0%, 15%, or 20% depending on your total income for the year. If you sell within one year, the gain is taxed as ordinary income, which can be as high as 37%.

This is one of the simplest strategies: if you're close to the one-year mark, waiting a few more months can cut your tax bill significantly. A $50,000 gain taxed at 37% (ordinary income) costs $18,500; the same gain at 15% (long-term) costs $7,500. The difference is $11,000.

Long-term capital gains rates also depend on your filing status and total income. For 2024, the 0% rate applies to single filers with income up to $47,025 and married filers with income up to $94,050. If your gain would push you into the 15% or 20% bracket, you might be able to time the sale across two tax years to stay in the lower bracket.

Charitable donations and opportunity zones for specialized situations

If you donate appreciated property to a may have access to charity, you avoid capital gains tax on the appreciation entirely and also get a charitable deduction for the full fair market value. This works best if you own property that has appreciated significantly and you want to support a cause anyway.

Opportunity zones are a federal program that defers and reduces capital gains tax if you reinvest gains into businesses or real estate in designated low-income areas. You defer tax on the original gain until 2026, and if you hold the opportunity zone investment for at least ten years, you exclude the new gains from tax. This is complex and requires careful structuring, but it can be powerful for large gains.

Both of these strategies require planning before you sell. You can't donate property to charity after the sale and claim the benefit, and you must invest in an opportunity zone within 180 days of realizing the gain. Work with a tax professional if either option interests you.

What not to do: common mistakes that backfire

Do not try to claim the primary residence exclusion if you don't meet the two-of-five-years test. The IRS will disallow it, and you'll owe back taxes plus penalties. If you sold a home in the last two years and used the exclusion, you cannot use it again until two years have passed from that sale.

Do not attempt a 1031 exchange without a may have access to intermediary. If you touch the money yourself, even briefly, the entire exchange fails and you owe tax on the full gain. The 45-day and 180-day important date are absolute; the IRS will not extend them for any reason.

Do not assume that a loss on the sale of your primary residence is tax-deductible. It isn't. You can only deduct losses on investment property, and even then, only in certain circumstances. If you're selling at a loss, there's no capital gains tax to avoid.

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. However, the exclusion applies only to the portion of the gain attributable to the part you lived in. If you rented out 25% of the home, you exclude 75% of the gain and owe tax on 25%. You'll need to allocate the purchase price and sale price between the residential and rental portions.

What happens if I do a 1031 exchange and the replacement property is worth less than the sale price?

You'll owe tax on the difference, called "boot." If you sell for $500,000 and buy a replacement for $450,000, you have $50,000 in boot and must pay tax on that amount. To defer all tax, the replacement must be equal or greater in value.

Can I do a 1031 exchange on my primary home?

No. The 1031 exchange applies only to property held for investment or business use. Your primary residence does not may have access to, even if you also rent out part of it. You would use the primary residence exclusion instead.

Do state capital gains taxes count toward the federal tax I owe?

No. State and federal capital gains taxes are separate. Some states have no capital gains tax; others tax it at rates up to 13%. You owe both the federal tax and your state's tax, if applicable. Some strategies like 1031 exchanges defer federal tax but not state tax.

If I inherited property, 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 because the gain is small. This is one of the largest tax benefits in the code.