Capital gains tax on real estate can take a big bite out of a sale, and November is when most sellers start running the numbers. The good news is that you have more options than writing a check. Some cut the tax, some push it out for years, and one can make future growth tax-free. Here is how the tax works and six ways to lower it, before you sign at the closing table.
How capital gains tax on real estate works
Your gain is the sale price minus your selling costs and your adjusted basis. Basis is roughly what you paid plus improvements, minus any depreciation you took. Then the rate depends on how long you owned the property and what you earn.
| Piece of the gain | Federal rate |
|---|---|
| Owned one year or less | Ordinary income rates |
| Owned more than one year | 0%, 15% or 20%, depending on income |
| Depreciation taken on a rental | Up to 25% |
| Net investment income tax | 3.8% more above $200,000 of income, or $250,000 for a married couple |
Most states tax the gain too, so capital gains tax on real estate can run well past the federal rate. The IRS covers the basics in Topic 409, capital gains and losses.
Six ways to avoid capital gains tax on real estate
1. Use the home sale exclusion
If you owned and lived in the home as your main home for at least two of the last five years, you can generally exclude up to $250,000 of gain, or $500,000 for a married couple filing jointly. Gain above that is taxable, and it can still go into an Opportunity Zone.
2. Trade up with a 1031 exchange
A 1031 exchange swaps one investment or business property for another. You have 45 days to identify the replacement and 180 days to close, and you need to reinvest the full sale price to defer all of the tax. The tax is put off until you sell without another exchange. It works best if you want to keep owning real estate.
3. Reinvest just the gain in an Opportunity Zone
An Opportunity Zone investment only needs the gain. You invest it in a Qualified Opportunity Fund within 180 days of the sale and keep your original basis to use however you want. Starting January 1, 2027, OZ 2.0 gives new investments a five-year deferral and a 10% step-up, or 30% in a qualified rural fund. Hold ten years and the growth on the investment can be free of federal capital gains tax.
“A 1031 exchange and private equity got married and they had a beautiful baby and they named it Opportunity Zones.”
Ashley Tison
A failed 1031 is one of the most common ways people find us. If you cannot find a replacement in time, or you take cash out of an exchange, that taxable gain can often go into an Opportunity Zone fund instead. See 1031 exchange vs. Opportunity Zone.
4. Spread the gain with an installment sale
If the buyer pays you over time, you generally report the gain as the payments come in, which can keep you out of the top brackets. Depreciation recapture is usually taxed in the year of sale, and you take on the risk that the buyer stops paying.
5. Offset it with losses
Capital losses from other sales, including losses carried forward from earlier years, net against the gain. Year-end is when most people look through their brokerage accounts for positions they would sell anyway.
6. Hold it
Heirs generally receive property with a basis stepped up to its value at death, which wipes out the built-in gain, and the capital gains tax on real estate with it. It is not a sale strategy, but for some families it is the right answer.
Comparing your options for capital gains tax on real estate
| Option | What you reinvest | What happens to the tax |
|---|---|---|
| Home sale exclusion | Nothing | Up to $250,000 or $500,000 excluded |
| 1031 exchange | The full sale price, into real estate | Deferred until a later taxable sale |
| Opportunity Zone | Only the gain, into a fund | Deferred five years, reduced 10% or 30%, growth tax-free after ten years |
| Installment sale | Nothing | Spread over the years you are paid |
| Harvesting losses | Nothing | Reduced by the losses you take |
The year-end timing question
If you are closing soon, the date matters for capital gains tax on real estate. A December closing puts the gain on your 2026 return. A January closing generally puts it on your 2027 return. Either way, a sale this late in the year leaves a 180-day window that runs into 2027, so the gain can go into an OZ 2.0 fund. See can a 2026 gain use OZ 2.0, or check your numbers on our 2026 gains page.
Capital gains tax on real estate FAQ
How much is capital gains tax on real estate?
It depends on how long you owned the property and your income. Property held a year or less is taxed at ordinary income rates. Property held longer is taxed at 0%, 15%, or 20% federally, plus the 3.8% net investment income tax for higher earners. Depreciation you took on a rental can be taxed at up to 25%. Most states add their own tax.
Can I avoid capital gains tax on real estate completely?
Sometimes. A home you lived in can exclude up to $250,000 of gain, or $500,000 for a married couple. Property held until death generally gets a stepped-up basis. For investment property, most strategies defer or reduce the tax, and an Opportunity Zone held ten years can make the growth on your reinvested gain free of federal capital gains tax.
Is an Opportunity Zone better than a 1031 exchange?
Neither is better across the board. A 1031 suits owners who want to keep owning real estate and can reinvest the full sale price. An Opportunity Zone only needs the gain, works with almost any asset, and offers tax-free growth after ten years.
Does it matter if I close in December or January?
Yes. The closing date generally decides which tax year the gain falls in. A January 2027 closing puts the gain on your 2027 return, and an Opportunity Zone investment of that gain falls under OZ 2.0. Talk to your CPA before you move a closing date.
Sources
- IRS Topic No. 409, Capital gains and losses
- IRS Publication 523, Selling your home
- 26 U.S. Code 1031, Exchange of real property
- 26 U.S. Code 1400Z-2, Special rules for capital gains invested in opportunity zones
Selling a property and want to see how an Opportunity Zone compares for your gain? Book a free 15-minute call.
General information, not tax or legal advice. Rules change, and your facts change the answer.



