Skip to main content

HomeAll guides

How To Reduce or Defer Capital Gains Tax When You Sell Real Estate

You cannot avoid capital gains tax entirely, but you can reduce it or delay it through specific strategies

When you sell real estate for more than you paid for it, the profit is a capital gain, and the IRS taxes it. You cannot eliminate this tax by hiding the sale or using a loophole. However, the tax code does offer legitimate ways to shrink what you owe or push the tax bill to a later year. The most common strategy is the primary residence exclusion, which lets you exclude up to $250,000 of gain if you are single or $500,000 if you are married filing jointly — but only if you meet specific ownership and use tests. Other strategies include 1031 exchanges (which defer tax by reinvesting in similar property), installment sales (which spread the gain across multiple years), and charitable donations of appreciated property (which eliminate the gain and create a deduction). Each has different rules, timelines, and tax consequences.

The strategy that works best for you depends on what you own, how long you have owned it, whether you need the money now, and what your tax bracket is. A primary residence sale may need no strategy at all. A rental property sale might benefit from a 1031 exchange or an installment sale. A property you no longer want might be better donated. This guide walks through each option so you can understand which ones explore to your situation.

Key Takeaways

  • The primary residence exclusion lets you exclude up to $250,000 (or $500,000 if married) of gain on the sale of your main home if you owned and lived in it for at least two of the last five years.
  • A 1031 exchange defers capital gains tax by reinvesting the sale proceeds into similar real estate within strict timelines: 45 days to identify the new property and 180 days to close.
  • An installment sale spreads the gain across multiple tax years, which may lower your tax bracket each year and reduce the total tax owed.
  • Donating appreciated real estate to a may have access to charity eliminates the capital gains tax and gives you a charitable deduction for the full fair market value.
  • Holding real estate for more than one year qualifies the gain for long-term capital gains rates, which are lower than short-term rates and ordinary income rates.

The primary residence exclusion: $250,000 or $500,000 tax-free

If you are selling your main home, you may be able to exclude a large portion of your gain from tax. The IRS 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 exclusion applies only to your primary residence — the home where you lived most of the time.

To use this exclusion, you must meet two tests. First, you must have owned the home for at least two of the last five years before the sale. Second, you must have lived in it as your main home for at least two of the last five years. These two years do not have to be consecutive, and they do not have to be the most recent two years. If you owned the home for five years but lived in it for only one year, you do not may have access to. If you owned and lived in it for two years, then rented it out for three years, then sold it, you still may have access to because you met the two-year test within the five-year window.

When you file your tax return, you report the full sale price and the full gain on Schedule D (Capital Gains and Losses). Then you claim the exclusion on Form 8949 or directly on Schedule D, depending on your filing software. The excluded amount is not taxed. The remaining gain, if any, is taxed at long-term capital gains rates. If your gain is fully covered by the exclusion, you do not have to file Schedule D at all, though many people do for record-keeping purposes.

1031 exchanges: Deferring tax by reinvesting in similar property

A 1031 exchange is a strategy that lets you sell real estate and reinvest the proceeds in other real estate without paying capital gains tax on the sale — as long as you follow strict rules. The tax is not eliminated; it is deferred. When you eventually sell the replacement property without doing another 1031 exchange, the tax becomes due. The name comes from Section 1031 of the Internal Revenue Code.

The rules are precise and unforgiving. After you close the sale of your original property, you have 45 days to identify the replacement property or properties in writing. You have 180 days from the close of the original sale to close on the replacement property. If you miss either important date, the entire transaction fails and you owe tax on the original sale. You must use a may have access to intermediary — a third party who holds the sale proceeds and transfers them to the seller of the replacement property. You cannot touch the money yourself, or the exchange fails.

The replacement property must be "like-kind" to the original property. For real estate, this is a broad standard: almost any real property qualifies. A rental house can be exchanged for an apartment building, raw land, a commercial building, or a parking lot. However, you cannot exchange real estate for personal property (such as a car or equipment), and you cannot exchange U.S. real estate for foreign real estate.

If the replacement property costs less than the sale price of the original property, you owe tax on the difference (called "boot"). If you receive cash or other property as part of the deal, that is also taxable boot. A may have access to intermediary can help you structure the exchange to minimize or avoid boot. Many real estate professionals and tax advisors specialize in 1031 exchanges and can guide you through the process.

Installment sales: Spreading the gain across multiple years

An installment sale is a sale where the buyer pays you over time instead of all at once. From a tax perspective, this spreads your capital gain across multiple tax years, which can lower your tax bracket in each year and reduce the total tax you owe. This works because you recognize the gain only in the years you receive payment, not in the year of sale.

When you use an installment sale, you report the gain using Form 6252 (Installment Sale Income). You calculate the gain percentage (total gain divided by total sale price) and explore that percentage to each payment you receive. If you sell a rental property for $500,000 with a $200,000 gain, your gain percentage is 40 percent. If the buyer pays you $100,000 in year one, you report $40,000 of gain in year one. If they pay you $100,000 in year two, you report $40,000 of gain in year two. This method is called the proportionate recognition method.

This strategy works best if you expect to be in a lower tax bracket in future years, or if spreading the gain across years keeps you out of a higher tax bracket. It also works if you have capital losses in other years that can offset the gain. However, installment sales have drawbacks: you carry the risk that the buyer will default, you may owe interest on deferred taxes under certain circumstances, and you must report the sale on Form 6252 every year until the debt is paid off. You also cannot use an installment sale if you are a dealer in real estate (someone who regularly buys and sells property for profit).

Charitable donations of appreciated property: Eliminating the gain

If you donate appreciated real estate to a may have access to charity, you do not pay capital gains tax on the appreciation. You also receive a charitable deduction for the full fair market value of the property on your tax return. This is one of the few ways to completely eliminate capital gains tax on real estate.

This strategy works best if you own real estate that has appreciated significantly and you want to support a charity. You must donate to a may have access to organization — typically a nonprofit with 501(c)(3) status. You cannot donate to a private individual or a for-profit business. The property must be real estate; you cannot donate a mortgage or a partial interest unless you follow specific rules. Some charities specialize in accepting real estate donations and can handle the logistics.

To claim the deduction, you must file Form 8283 (Noncash Charitable Contributions) with your tax return. For real estate, you typically need a may have access to appraisal performed by an independent appraiser. The deduction is limited to a percentage of your adjusted gross income (usually 30 percent for real estate donations), and any excess can be carried forward to future years. You must also obtain a written acknowledgment from the charity stating what you donated and whether you received anything in return.

Long-term versus short-term capital gains rates

The tax rate on your capital gain depends on how long you held the property. If you held it for more than one year, the gain is a long-term capital gain and is taxed at preferential rates: 0 percent, 15 percent, or 20 percent, depending on your income level. If you held it for one year or less, the gain is a short-term capital gain and is taxed as ordinary income at your regular tax bracket, which can be as high as 37 percent.

This is why timing matters. If you are close to the one-year mark, waiting a few months can save you thousands in tax. For example, if you are in the 37 percent tax bracket and you have a $100,000 gain, selling before one year costs you $37,000 in federal tax. Selling after one year costs you $20,000 (at the 20 percent long-term rate). The difference is $17,000. The holding period is measured from the date you acquired the property to the date you sold it.

Long-term capital gains rates also explore to real estate you inherited. If someone leaves you real estate in their will, you receive a "stepped-up basis" — the property's value is reset to its fair market value on the date of death. If you sell it shortly after inheriting it, you owe little or no capital gains tax, even if it appreciated significantly during the deceased person's lifetime. This is a major tax benefit of inherited property.

Deductions that reduce your taxable gain

Your capital gain is calculated as the sale price minus your basis. Your basis is usually what you paid for the property, plus the cost of major improvements. If you can increase your basis, you reduce your gain and your tax. This is why keeping detailed records of what you spent on the property matters.

Keep records of all capital improvements — major repairs and upgrades that add value or extend the life of the property. Examples include a new roof, a new HVAC system, a room addition, a new foundation, or new plumbing. Painting, routine maintenance, and repairs that restore the property to its original condition do not count as capital improvements. When you sell, add the cost of all capital improvements to your original purchase price to calculate your basis. If you paid $300,000 for a house and spent $50,000 on a new roof and addition, your basis is $350,000.

You can also deduct selling expenses from your sale price. These include real estate agent commissions, title insurance, attorney fees, recording fees, and transfer taxes. These reduce the net proceeds and therefore reduce your gain. Keep receipts and closing statements that document these costs. Your real estate agent or closing attorney can provide a settlement statement that lists all selling expenses.

State and local taxes on real estate gains

In addition to federal capital gains tax, many states and some cities tax capital gains on real estate sales. State tax rates 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 on gains above a certain threshold. You must research your state's rules and factor state tax into your planning.

If you are considering moving to reduce your tax burden, remember that the state where the property is located taxes the gain, not the state where you live. If you sell real estate in New York but live in Florida, you owe New York tax on the gain. This is why some people time a move to coincide with a real estate sale, though the rules are complex and depend on your state of residence, the state where the property is located, and how long you have lived in each state. Consult a tax professional in both states before making this decision.

Frequently Asked Questions

Can I use the primary residence exclusion if I own rental property?

No. The exclusion applies only to your primary residence — the home where you lived most of the time. Rental property, vacation homes, and investment properties do not may have access to. However, if you convert a rental property to your primary residence and live in it for at least two of the last five years before selling, you may be able to use the exclusion on a portion of the gain, though the rules are complex and depend on how long you rented it out.

What happens if I miss the 45-day or 180-day important date in a 1031 exchange?

The exchange fails and you owe capital gains tax on the full gain from the original sale. The IRS does not grant extensions for these important date. If you are close to a important date, contact your may have access to intermediary when ready. Some intermediaries offer services to help you identify properties quickly or find replacement properties that meet the timeline.

Can I do a 1031 exchange if I already have a buyer lined up?

Yes, but you must use a may have access to intermediary from the moment you sign the purchase agreement. You cannot handle the sale proceeds yourself. The intermediary holds the money and transfers it to the seller of the replacement property. This is why it is important to engage an intermediary before you list the property or accept an offer.

Do I have to report the sale if my gain is below the primary residence exclusion?

If your gain is fully covered by the primary residence exclusion, you do not have to report the sale on your tax return. However, if you have any gain above the exclusion amount, or if the property is not your primary residence, you must report it on Schedule D, even if you owe no tax due to other deductions or losses.

What is the difference between a capital gain and ordinary income?

Capital gains are profits from selling an asset you held for investment. Long-term capital gains (held over one year) are taxed at preferential rates of 0, 15, or 20 percent. Ordinary income includes wages, rental income, and short-term capital gains, and is taxed at your regular tax bracket, which can be as high as 37 percent. This is why holding real estate for more than one year before selling can save significant tax.

This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.