Big Sale TaxHans Goldstein: Tax & Exit Planning
Home / Capital Gains / Avoiding tax on real estate
Avoid or defer the tax

How to Avoid Capital Gains Tax on Real Estate: Eight Legal Methods and What Each Saves

Short answerYou can avoid capital gains tax on real estate completely only by excluding gain on your main home (up to $250,000 single, $500,000 joint), by holding until death for a stepped-up basis, or by donating the property. Everything else defers or spreads the tax: a 1031 exchange, an installment sale, an opportunity zone, a charitable remainder trust. In our Arizona rental example (federal plus state), spreading a $750,000 gain over five years cuts the total tax from $180,283 to $152,378.

The eight methods compared

Every method either removes the gain, defers it to a later year, or spreads it. None are available for every property, and several carry costs or risks. Use the table to see which fits your sale before reading the details.

MethodEffectBest fitMain limit
Home-sale exclusion (IRC 121)Excludes up to $250,000 / $500,000 (2026)Your main home2-of-5-year test; not for rentals
1031 exchange (IRC 1031)Defers all gainInvestment and business real estate45-day / 180-day deadlines; buy equal or greater value
Installment sale (IRC 453)Spreads gain over note termSeller can carry financingBuyer credit risk; recapture taxed in year one
Step-up at death (IRC 1014)Erases gain for heirsOwners who can hold for lifeConcentrated, illiquid, not a sale strategy
Opportunity zone fundDefers gain invested within 180 daysLong-horizon investorsInvestment risk; rules changed in 2025
Charitable remainder trust (IRC 664)Defers and spreads over a payout streamCharitable intentGift is irrevocable
Donation of the propertyAvoids gain; income-tax deductionPhilanthropic ownersYou give up the asset
Offset with losses (IRC 1211)Cancels gain dollar for dollarAnyone with realized lossesOnly realized, same-year or carried losses

Exclude the gain on your home

The only complete exclusion for a living owner is the main-home rule. Own it and live in it for 2 of the 5 years before sale and you exclude up to $250,000 of gain, or $500,000 filing jointly. Depreciation you claimed after May 6, 1997 is not excluded.

A rental that becomes your residence for the last two years can qualify in part. The full rules are on selling a house.

Defer with a 1031 exchange

For investment or business real estate, a like-kind exchange under IRC 1031 defers all the gain if you identify replacement property within 45 days and close within 180 days, using a qualified intermediary, and buy property of equal or greater value with all the proceeds.

Since 2018, only real property qualifies. The gain is not forgiven; your basis carries into the new property, and the deferred gain and depreciation recapture come due when you eventually sell for cash.

If you cannot find a replacement, an installment sale instead of a 1031 is the common alternative, and a failed exchange has its own consequences (failed 1031 exchange). Start with the 1031 exchange analysis.

Spread the gain with an installment sale

If you receive at least one payment after the year of sale, you can report the gain as payments come in (IRC 453). Each payment carries a gross-profit share of gain. In our Arizona example the rental produces a $750,000 gain.

Sold for cash in one year, the federal and state tax is $180,283. Sold on a five-year note with equal principal payments, tax is $152,378 in total, a difference of $27,905, because the long-term gain is spread across lower brackets and below the 3.8% NIIT threshold in some years.

Depreciation recapture is reported in year one regardless of when you are paid, so the $150,000 of unrecaptured 1250 gain is in the first year. Note interest is taxable. Run your own case in the installment sale analysis.

Hold until death for a stepped-up basis

Property included in a decedent's estate takes a basis equal to its fair market value at death (IRC 1014). An heir who inherits a building bought for $200,000 and worth $950,000 and sells it at $1,000,000 has a $40,000 gain, not an $800,000 one, and pays $7,980 of tax in Illinois on the example.

Heirs also receive long-term treatment automatically. This is the largest single tax-avoidance feature in the code for real estate, and the reason many owners never sell. The cost is that the property stays illiquid and concentrated. See step-up at death and inherited property.

Opportunity zones, charitable trusts and donation

A Qualified Opportunity Fund investment of capital gain within 180 days of the sale defers recognition of the invested gain, and the program was changed by 2025 legislation (see opportunity zones).

A charitable remainder trust sells the property inside the trust without immediate tax and pays you income for a term or life, spreading the gain over the payout (IRC 664). Donating the property outright to a qualified charity avoids the gain and produces a deduction.

Each commits the property or the proceeds to a structure you cannot reverse.

What none of these remove: depreciation and the 3.8% surtax

Depreciation taken on rental real estate is taxed on a sale at up to 25% in 2026 (unrecaptured section 1250 gain) unless you defer through a 1031 or hold until death. Investors with modified AGI above $250,000 joint or $200,000 single also owe the 3.8% net investment income tax on the gain (IRC 1411).

Check both on your own sale in the capital gains tax calculator, and see depreciation recapture for how the 25% layer is computed.

What to know

Deferral is not avoidance: the tax comes due later, sometimes at higher rates, and a failed deadline can make a 1031 exchange fully taxable. Installment notes put the buyer's credit risk on you. Aggressive structures such as monetized installment sales are listed by the IRS as abusive.

Results here use 2026 federal tables (Rev. Proc. 2025-32) and modeled state rules, and assume the incomes in each example. This is general information, not tax advice; use a CPA or attorney for a sale.

How much tax does this sale cause? A worked example

Joint filers, $150,000 of other income. A rental sold for a $750,000 gain: $150,000 is depreciation (unrecaptured 1250 gain) and $600,000 is long-term gain, all in one year. Same gain spread over five years with equal principal payments.

The 1250 gain is taken first in year one, then $150,000 of long-term gain a year for four years. Other income of $150,000 each year. Heir inherits a building the parent bought for $200,000, value at death $950,000, and sells for $1,000,000 less costs: $40,000 gain after step-up. Single heir, $140,000 other income, Illinois.

Engine runCash sale of an Arizona rental, one yearSame rental sold on a five-year installment noteInherited apartment sold at stepped-up basis
Filing statusMarried, jointMarried, jointSingle
StateArizonaArizonaIllinois
Tax years151
Other income (wages, pension, interest) per year$150,000$150,000$140,000
Long-term capital gain$600,000$600,000$40,000
Unrecaptured Section 1250 gain (25% max)$150,000$150,000$0
Federal income tax on the sale$136,833$124,128$6,000
Net investment income tax (3.8%)$24,700$9,500$0
State income tax on the sale$18,750$18,750$1,980
Total tax caused by the sale$180,283$152,378$7,980
Effective rate on the gain24.0%20.3%20.0%
Gain kept after these taxes$569,717$597,622$32,020

Computed November 6, 2026 by the Big Sale Tax engine (engine.js yearTax): federal brackets, 0/15/20% thresholds and AMT from Rev. Proc. 2025-32 (OBBBA-adjusted) and the One Big Beautiful Bill Act (P.L. 119-21); NIIT under IRC 1411 (thresholds not indexed); state tax from the engine's state table. "Tax caused by the sale" = tax with the sale minus tax without it. Excludes selling costs, local taxes and estimated-tax timing. Education only.

How much tax would you owe? Run your own numbers

Federal on the sale$136,833
NIIT$24,700
State$18,750
Total tax, held over a year$180,283
Effective rate24%
If held one year or less$271,361

2026 law from the engine: federal 0/15/20% brackets (Rev. Proc. 2025-32), 25% cap on unrecaptured 1250 gain, ordinary rates on 1245 recapture, 3.8% NIIT over $200,000 single / $250,000 joint (IRC 1411), AMT, and your state's rules (California on the FTB 2026 schedules).

What was sold and years held only matter in a few states: Washington exempts real estate, Ohio and New Mexico treat a business sale differently, Arizona subtracts 25% for assets bought after 2011 and Oklahoma deducts gain on Oklahoma property held 5 years or more.

Tax shown is the tax caused by the sale. Excludes local taxes other than Maryland's county tax (3.2% used). Tick the active-owner box if you materially participate in the business. Education only.

Free PDF sheet

Long-Term vs Short-Term Capital Gains (2026)

The one-year holding rule, the 2026 0/15/20% thresholds for every filing status, NIIT, recapture, the state layer and a worked $200,000 example: 11 months vs 13 months, and what spreading the gain can save.

Hans Goldstein
Enrolled Agent, admitted to practice before the IRS

By entering your email you agree to receive this sheet and occasional educational emails from Hans Goldstein: Tax & Exit Planning. Unsubscribe anytime.

Frequently asked questions

How can I avoid paying capital gains tax on real estate?
The complete exclusions are the main-home exclusion (IRC 121), stepped-up basis at death (IRC 1014) and donation. Other tools defer or spread the tax: a 1031 exchange, installment sale, opportunity zone investment or charitable remainder trust.
Can I avoid capital gains if I reinvest the money in another house?
Not automatically. Buying another home does not defer gain on a primary residence. For investment property a 1031 exchange into like-kind real property defers it if you follow the 45-day and 180-day deadlines.
How long do I have to own a rental property to avoid capital gains?
There is no holding period that avoids the tax on a rental. Holding more than a year gives the lower long-term rates, and depreciation is still taxed at up to 25% when you sell.
Does paying down a mortgage or buying a second property avoid tax?
No. Paying the loan or buying other property does not change the gain unless the purchase is part of a qualifying 1031 exchange.
Does moving to a state with no income tax avoid capital gains tax?
It avoids state tax on gains from intangible property, but many states still tax gain on real property located in the state regardless of where you live.
What is the IRS 45-day and 180-day rule?
In a 1031 exchange you must identify replacement property in writing within 45 days of closing the sale and acquire it within 180 days, or by your tax return due date if sooner (IRC 1031(a)(3)).
How Hans helps: the Big Sale Tax Analysis runs your sale through every path that fits: a cash sale, a Section 453 installment sale, 1031, Opportunity Zones, charitable trusts, timing and loss offsets, year by year, and ends with a written recommendation your CPA can check. Get the Big Sale Tax Analysis.
Next step

Know your number before you sign.

Start with a free scope call: a short call to see whether the Big Sale Tax Analysis is worth it for your sale. No obligation.

Prefer email? Request the analysis by email.

You talk to Hans Goldstein. Enrolled Agent, admitted to practice before the IRS.

Book a free scope callCall Hans