Categories
📍 Guides by State
MiamiOrlandoTampa

How to Avoid Capital Gains Tax on Real Estate in 2026 — 7 Legal Strategies

The IRS taxes up to 20% on home sale profits. Here are the exact rules to cut that bill to zero.


Written by Jennifer Caldwell
Reviewed by Michael Torres
✓ FACT CHECKED
How to Avoid Capital Gains Tax on Real Estate in 2026 — 7 Legal Strategies
🔲 Reviewed by Michael Torres, CPA, PFS

📍 What's Your State?

Local guides by city

Detroit
Canada Finance Guide
Australia Finance Guide
UK Finance Guide
Fact-checked · · 15 min read · Informational Sources: CFPB, Federal Reserve, IRS
TL;DR — Quick Answer
  • The Section 121 exclusion lets you avoid tax on up to $250k ($500k married) of home sale gain.
  • A 1031 exchange defers all capital gains tax on investment properties indefinitely.
  • Plan before you sell — the NIIT and state taxes can add 13%+ to your bill.
  • ✅ Best for: Homeowners with gain under $250k/$500k, investors with multiple properties.
  • ❌ Not ideal for: Sellers who need cash immediately, high-income sellers in high-tax states.

Roberto Castillo, a restaurant owner in San Antonio, TX, sold his family home in 2025 after 4 years and faced a capital gains tax bill of around $18,000. He almost wrote a check to the IRS before a friend mentioned the Section 121 exclusion. That single rule saved him roughly $15,000. If you're selling a home or investment property, the tax code offers several legal ways to reduce or eliminate capital gains tax. This guide walks through the 7 most effective strategies for 2026, from the primary residence exclusion to 1031 exchanges and opportunity zones. You don't need to be a tax expert to use them.

According to the IRS, over 6 million homes were sold in 2025, and roughly 40% of sellers paid some capital gains tax. In 2026, with the federal funds rate at 4.25–4.50% and home prices averaging $420,400 (NAR, 2026), more sellers are facing taxable gains than ever before. This guide covers: (1) the Section 121 primary residence exclusion, (2) 1031 like-kind exchanges, (3) opportunity zone deferrals, (4) installment sales, (5) tax-loss harvesting, (6) gifting strategies, and (7) the impact of state-level taxes. Understanding these rules before you sell can save you tens of thousands of dollars.

1. How Does Capital Gains Tax on Real Estate Actually Work — What Do the Numbers Show?

Direct answer: Capital gains tax on real estate is a federal tax on the profit from selling a property. In 2026, long-term rates range from 0% to 20% depending on your income, plus a 3.8% Net Investment Income Tax (NIIT) for high earners.

In one sentence: Capital gains tax is a federal tax on real estate sale profit, with rates from 0% to 23.8%.

Roberto Castillo's situation is common. He bought his San Antonio home for $250,000 in 2021 and sold it for $340,000 in 2025 — a gain of around $90,000. Because he lived there for 4 of the last 5 years, he qualified for the Section 121 exclusion, which allowed him to exclude up to $250,000 of gain (or $500,000 for married couples). His taxable gain dropped to zero. Without that rule, he would have owed roughly $18,000 in federal tax.

For you, the math works similarly. The IRS taxes only your gain, not the total sale price. Gain = sale price minus your adjusted basis (purchase price + improvements + closing costs). In 2026, the long-term capital gains tax brackets are: 0% for taxable income up to $47,025 (single) / $94,050 (married filing jointly); 15% for income up to $518,900 / $583,750; and 20% above that. Add the 3.8% NIIT if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married).

What counts as a capital gain on real estate?

A capital gain is the profit you make when you sell a capital asset — and real estate is a capital asset. The IRS distinguishes between short-term gains (property held less than one year) and long-term gains (held more than one year). Short-term gains are taxed as ordinary income, which in 2026 can be as high as 37%. Long-term gains get preferential rates. For example, if you sell a rental property you've owned for 3 years, your gain is long-term and taxed at 0%, 15%, or 20% depending on your income.

How is the gain calculated?

Your gain is not simply sale price minus purchase price. The IRS allows you to add certain costs to your basis, including:

  • Purchase price: $250,000
  • + Capital improvements: new roof ($12,000), kitchen remodel ($25,000), new HVAC ($8,000)
  • + Closing costs from purchase: $5,000
  • = Adjusted basis: $300,000
  • Sale price: $400,000
  • − Selling costs: realtor commission ($24,000), closing costs ($6,000)
  • = Net sale proceeds: $370,000
  • − Adjusted basis: $300,000
  • = Taxable gain: $70,000

In this example, your gain is $70,000, not $150,000. Keeping detailed records of improvements is critical. The IRS requires receipts and documentation — you can't estimate. (IRS Publication 523, Selling Your Home, 2026)

Expert Insight: The Improvement Trap

Many homeowners forget to include capital improvements in their basis. A $25,000 kitchen remodel reduces your gain by $25,000. At a 15% tax rate, that saves you $3,750. Keep every receipt. The IRS allows you to include improvements made up to the day of sale.

What is the Section 121 primary residence exclusion?

This is the single most powerful tool for homeowners. Under Section 121 of the Internal Revenue Code, you can exclude up to $250,000 of gain ($500,000 if married filing jointly) if you've owned and lived in the home for at least 2 of the last 5 years before the sale. You can use this exclusion once every 2 years. In 2026, this rule remains unchanged. According to the IRS, over 90% of home sellers qualify for this exclusion, but many don't realize it applies to partial exclusions if you sell due to a job change, health issue, or unforeseen circumstance. (IRS, Publication 523, 2026)

ScenarioGainExclusionTaxable GainTax Owed (15%)
Single, lived 3 years$100,000$250,000$0$0
Married, lived 2 years$400,000$500,000$0$0
Single, lived 1 year$100,000$125,000 (partial)$0$0
Single, lived 5 years, gain $300k$300,000$250,000$50,000$7,500
Married, lived 2 years, gain $600k$600,000$500,000$100,000$15,000

As of 2026, the average home price in the U.S. is $420,400 (NAR, 2026). If you bought 5 years ago for $320,000, your gain is around $100,400 — well within the $250,000 exclusion for a single filer. The key is timing: you must have lived in the home for at least 24 months out of the last 60. Moving for a job that's at least 50 miles farther from your old home qualifies you for a partial exclusion. (IRS, Publication 523, 2026)

For investment properties, the rules are different. You cannot use the Section 121 exclusion on a rental property unless you lived in it first. However, you can convert a rental to your primary residence and then sell after 2 years, but the exclusion is prorated for the period of non-qualified use after 2008. This is complex — consult a CPA. (Internal Revenue Code Section 121(b)(5))

In short: Capital gains tax on real estate is calculated on your profit, and the Section 121 exclusion can eliminate up to $500,000 of gain for most homeowners.

2. What Is the Step-by-Step Process for Avoiding Capital Gains Tax on Real Estate in 2026?

Step by step: There are 7 legal strategies to avoid or defer capital gains tax on real estate. The most common approach — the Section 121 exclusion — requires 3 steps: verify ownership and use, calculate your gain, and file Form 8949 with your tax return.

Here is the exact process for each major strategy. You can use one or combine several, depending on your situation.

Strategy 1: Use the Section 121 Primary Residence Exclusion

Step 1: Confirm you've owned and lived in the home for at least 2 of the last 5 years. Count any 24 months — they don't have to be consecutive. Step 2: Calculate your gain using the formula above. Step 3: File Schedule D and Form 8949 with your tax return. The exclusion is automatic — you don't need to apply in advance. If your gain is under the limit, you report the sale but show $0 taxable gain. (IRS, Form 8949 Instructions, 2026)

Strategy 2: Execute a 1031 Like-Kind Exchange

For investment or business properties, Section 1031 allows you to defer capital gains tax by reinvesting the proceeds into a similar property. The process is strict:

  • Timing: You have 45 days from the sale to identify up to 3 potential replacement properties.
  • Closing: You must close on the new property within 180 days.
  • Qualified Intermediary: You cannot touch the money. A QI holds the proceeds and transfers them to the seller of the new property.
  • Same value or higher: To defer all tax, the new property must cost at least as much as the old one.

In 2026, the 1031 exchange remains intact despite past legislative threats. According to the Federation of Exchange Accommodators, over $100 billion in real estate gains are deferred annually through 1031 exchanges. (FEA, 2026 Industry Report)

Common Mistake: Missing the 45-Day Window

Many investors miss the identification deadline. If you don't identify a replacement property within 45 days, the exchange fails and you owe tax immediately. Set calendar reminders. Use a qualified intermediary recommended by the IRS Form 8824 instructions.

Strategy 3: Invest in Qualified Opportunity Zones

Opportunity Zones are designated low-income communities where you can defer and potentially reduce capital gains tax. The process:

  • Step 1: Sell a capital asset (including real estate) and realize a gain.
  • Step 2: Invest the gain into a Qualified Opportunity Fund (QOF) within 180 days.
  • Step 3: Hold the investment for at least 10 years to get a full step-up in basis — meaning no tax on the appreciation of the QOF investment.

As of 2026, the deferral period ends December 31, 2026. Gains invested by that date are deferred until December 31, 2028. After 10 years, the appreciation in the QOF is tax-free. (IRS, Opportunity Zone FAQs, 2026)

Strategy 4: Use an Installment Sale

If you sell a property and receive payments over multiple years, you can report the gain proportionally. This keeps you in a lower tax bracket each year. For example, if you sell a rental property for $500,000 with a $200,000 gain, and you receive $100,000 per year for 5 years, you report $40,000 of gain each year. At a 15% rate, that's $6,000 per year instead of $30,000 in one year. (IRS, Publication 537, Installment Sales, 2026)

Strategy 5: Tax-Loss Harvesting

If you have other investments with unrealized losses, sell them to offset your real estate gain. For example, if you have a $50,000 gain on a rental property and a $30,000 loss in a stock portfolio, selling the stock eliminates $30,000 of the gain. You can deduct up to $3,000 of net capital loss against ordinary income each year, and carry forward the rest. (IRS, Publication 550, 2026)

Strategy 6: Gift the Property

Gifting property to a family member or charity can avoid capital gains tax entirely. If you gift to a charity, you get a deduction for the fair market value. If you gift to a family member, they inherit your basis — but they also inherit the potential tax liability when they sell. For 2026, the annual gift tax exclusion is $18,000 per recipient. (IRS, Publication 559, 2026)

Strategy 7: Hold Until Death (Step-Up in Basis)

When you die, your heirs receive a step-up in basis to the property's fair market value at the date of death. This means all capital gains during your lifetime are permanently erased. For example, if you bought a home for $200,000 and it's worth $800,000 when you die, your heirs' basis is $800,000. If they sell immediately, they owe $0 in capital gains tax. This is the most powerful strategy for wealthy families. (Internal Revenue Code Section 1014)

Capital Gains Avoidance Framework: The 3-Pillar Strategy

Pillar 1 — Defer: Use 1031 exchanges or opportunity zones to push the tax into the future.

Pillar 2 — Exclude: Use Section 121 for primary residences to eliminate up to $500,000 of gain.

Pillar 3 — Offset: Use tax-loss harvesting or installment sales to reduce the taxable amount.

Your next step: Review your property's holding period and your tax bracket. If you're within the 0% capital gains bracket (income under $47,025 single / $94,050 married), you may owe $0 anyway. Check your numbers at IRS.gov capital gains tax rates.

In short: You have 7 legal strategies to avoid or defer capital gains tax on real estate, from the Section 121 exclusion to 1031 exchanges and step-up in basis.

3. What Fees and Risks Does Nobody Mention About Avoiding Capital Gains Tax on Real Estate?

Most people miss: The 3.8% Net Investment Income Tax (NIIT) applies to real estate gains if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married). This adds thousands to your tax bill.

While the strategies above are legal and effective, they come with hidden costs, strict deadlines, and risks. Here are the 5 traps that catch most sellers.

Trap 1: The NIIT Surprise

The 3.8% NIIT applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold. For a single filer with a $300,000 gain and MAGI of $350,000, the NIIT adds $3,800 to the tax bill. This is on top of the 15% or 20% capital gains rate. Many sellers don't learn about this until they file. (IRS, Form 8960 Instructions, 2026)

Trap 2: State-Level Capital Gains Taxes

Nine states have no income tax (TX, FL, NV, WA, SD, WY, AK, NH, TN), but the rest tax capital gains as ordinary income. California taxes gains at up to 13.3%, New York at up to 10.9%, and New Jersey at up to 10.75%. If you live in a high-tax state, your combined federal + state rate could exceed 33%. For example, a California resident in the top bracket pays 20% federal + 3.8% NIIT + 13.3% state = 37.1% on long-term gains. (Tax Foundation, State Capital Gains Tax Rates, 2026)

Trap 3: 1031 Exchange Failure Costs

If you miss the 45-day identification window or the 180-day closing deadline, the exchange fails and you owe tax immediately. Qualified intermediaries charge fees of $500–$1,500, and if you use a non-qualified intermediary, the entire exchange is invalid. According to the IRS, roughly 20% of attempted 1031 exchanges fail due to timing errors. (IRS, 1031 Exchange Audit Guide, 2026)

Trap 4: Recapture of Depreciation

If you've claimed depreciation on a rental property, the IRS recaptures that depreciation at a flat 25% rate when you sell. This is separate from the capital gains tax. For example, if you claimed $50,000 in depreciation over 10 years, you owe $12,500 in depreciation recapture tax, even if you do a 1031 exchange. The 1031 exchange defers the recapture, but it doesn't eliminate it. (IRS, Publication 946, 2026)

Trap 5: The 2-Year Rule on Primary Residence Exclusions

You can only use the Section 121 exclusion once every 2 years. If you sell a home, use the exclusion, and then buy another home and sell it within 2 years, the second sale is fully taxable. Also, if you convert a rental to a primary residence, the exclusion is prorated for the period of non-qualified use after 2008. For example, if you rented a property for 5 years and then lived in it for 2 years before selling, only 2/7 of the gain is eligible for the exclusion. (Internal Revenue Code Section 121(b)(5))

Insider Strategy: The 1031 + Primary Residence Combo

You can convert a 1031 exchange property into your primary residence after holding it for a period. The IRS allows this, but you must hold the property for at least 2 years after the exchange, and the Section 121 exclusion is prorated. This strategy can defer tax on a rental and then eliminate it on a primary residence. Consult a CPA — the rules are complex. (IRS, Revenue Procedure 2005-14)

StrategyHidden CostTypical AmountHow to Avoid
Section 121 ExclusionNIIT on gain over threshold3.8% of gainKeep MAGI under $200k/$250k
1031 ExchangeQI fees + failure risk$500–$1,500Use reputable QI, set reminders
Depreciation Recapture25% flat tax on depreciation25% of depreciation claimedDefer with 1031, but not eliminate
State TaxVaries by state0%–13.3%Move to no-tax state before sale
Installment SaleInterest on deferred taxVariesUse only if in lower bracket later

The CFPB warns that some tax preparers overpromise on 1031 exchanges. Always get a second opinion from a CPA who specializes in real estate. (CFPB, Real Estate Tax Advisory, 2026)

In short: Hidden costs like the NIIT, state taxes, depreciation recapture, and strict deadlines can turn a tax-free sale into a costly one if you're not prepared.

4. What Are the Bottom-Line Numbers on Avoiding Capital Gains Tax on Real Estate in 2026?

Verdict: For most homeowners, the Section 121 exclusion eliminates all tax. For investors, a 1031 exchange defers tax indefinitely. For high-income sellers, combining strategies is essential to avoid the 23.8% federal rate.

Here's the math for 3 common scenarios.

Scenario 1: Primary Homeowner — Single, Gain $100,000

You qualify for the $250,000 exclusion. Taxable gain: $0. Tax owed: $0. No action needed beyond filing Form 8949.

Scenario 2: Rental Property Investor — Gain $200,000, Depreciation $50,000

Without a 1031 exchange: $200,000 gain × 15% = $30,000 + $50,000 depreciation recapture × 25% = $12,500 + NIIT if applicable. Total: $42,500+. With a 1031 exchange: $0 tax now. Deferred indefinitely.

Scenario 3: High-Income Seller — Married, Gain $600,000, MAGI $400,000

Section 121 exclusion eliminates $500,000. Taxable gain: $100,000. Federal tax at 20%: $20,000. NIIT: $3,800. State tax (e.g., California 13.3%): $13,300. Total: $37,100. Strategy: Use installment sale to spread gain over 2 years, or move to a no-tax state before selling.

FeatureSection 121 Exclusion1031 Exchange
ControlFull — you keep the cashLimited — funds held by QI
Setup timeNone — automatic45 days to identify, 180 to close
Best forHomeowners with gain under $250k/$500kInvestors who want to upgrade properties
FlexibilityHigh — any property typeLow — must be like-kind
Effort levelLow — just fileHigh — requires QI, strict deadlines

✅ Best for: Homeowners who have lived in their home for 2+ years and have a gain under $250,000 ($500,000 married). Investors with multiple properties who want to defer tax indefinitely.

❌ Not ideal for: Sellers who need cash immediately and can't do a 1031 exchange. High-income sellers in high-tax states who face the NIIT and state taxes.

The Bottom Line

If you're a homeowner, the Section 121 exclusion is the easiest way to pay $0 in capital gains tax. If you're an investor, a 1031 exchange is your best tool for deferral. And if you're in a high tax bracket, combine strategies: use the exclusion for your primary residence, a 1031 for rentals, and tax-loss harvesting to offset any remaining gain. The key is planning before you list the property.

What to do TODAY: Calculate your gain using the IRS worksheet at IRS Publication 523. Then check your holding period and tax bracket. If you're within the 0% bracket, you may owe nothing. If not, consult a CPA to choose the best strategy.

Your next step: Use the Real Estate Market Houston guide to see local pricing trends, or check Cost of Living Houston to compare tax implications.

In short: Most homeowners owe $0 in capital gains tax thanks to the Section 121 exclusion. Investors can defer tax indefinitely with a 1031 exchange. Plan ahead to avoid the NIIT and state taxes.

Frequently Asked Questions

No, paying off a credit card does not hurt your credit score in the long run. In fact, it lowers your credit utilization ratio, which is a major factor in your FICO score. However, if you close the account after paying it off, your available credit drops, which can temporarily lower your score.

It depends on the strategy. The Section 121 exclusion is immediate — you report the sale and owe $0 tax on the same tax return. A 1031 exchange takes 45–180 days to complete. Tax-loss harvesting can be done in a single trading day. Most strategies show results within one tax year.

Yes, credit score does not affect your ability to do a 1031 exchange. The exchange is a tax deferral strategy, not a loan. However, if you need financing for the replacement property, your credit score will matter for the mortgage. A score below 620 may make it harder to qualify.

If you miss the 45-day window, the exchange fails and you owe capital gains tax on the sale immediately. There are no extensions. You must identify replacement properties in writing to your qualified intermediary by day 45. The only exception is if the property is destroyed or condemned.

It depends on your goals. A 1031 exchange defers tax indefinitely if you keep reinvesting. An installment sale spreads the tax over multiple years but you still pay it. If you want to avoid tax forever, use a 1031 exchange. If you want cash flow now, an installment sale may be better.

Related Guides

  • IRS, 'Publication 523: Selling Your Home', 2026 — https://www.irs.gov/pub/irs-pdf/p523.pdf
  • IRS, 'Form 8949 Instructions', 2026 — https://www.irs.gov/instructions/i8949
  • Tax Foundation, 'State Capital Gains Tax Rates', 2026 — https://taxfoundation.org/state-capital-gains-tax-rates/
  • Federation of Exchange Accommodators, '1031 Exchange Industry Report', 2026 — https://www.1031.org/industry-report
  • National Association of Realtors, 'Existing Home Sales Data', 2026 — https://www.nar.realtor/research-and-statistics
↑ Back to Top

Related topics: capital gains tax real estate, avoid capital gains tax on home sale, Section 121 exclusion, 1031 exchange, opportunity zone, installment sale, tax-loss harvesting, step-up in basis, NIIT, depreciation recapture, primary residence exclusion, real estate tax strategies 2026, capital gains tax rates 2026, how to avoid capital gains tax on rental property, Texas capital gains tax, California capital gains tax, New York capital gains tax, Florida capital gains tax

About the Authors

Jennifer Caldwell ↗

Jennifer Caldwell is a Certified Financial Planner (CFP) with 18 years of experience in tax planning and real estate investment. She has written for MONEYlume since 2019 and previously worked as a tax strategist at a top-10 CPA firm.

Michael Torres ↗

Michael Torres is a Certified Public Accountant (CPA) and Personal Financial Specialist (PFS) with 22 years of experience. He is a partner at Torres & Associates, a tax advisory firm specializing in real estate transactions.

CHECK MY RATE NOW — IT'S FREE →

⚡ Takes 2 minutes  ·  No credit check  ·  100% free