The IRS taxes up to 20% on home sale profits. Here are the exact rules to cut that bill to zero.
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.
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).
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.
Your gain is not simply sale price minus purchase price. The IRS allows you to add certain costs to your basis, including:
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)
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.
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)
| Scenario | Gain | Exclusion | Taxable Gain | Tax 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.
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.
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)
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:
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)
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.
Opportunity Zones are designated low-income communities where you can defer and potentially reduce capital gains tax. The process:
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)
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)
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)
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)
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)
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.
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.
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)
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)
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)
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)
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))
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)
| Strategy | Hidden Cost | Typical Amount | How to Avoid |
|---|---|---|---|
| Section 121 Exclusion | NIIT on gain over threshold | 3.8% of gain | Keep MAGI under $200k/$250k |
| 1031 Exchange | QI fees + failure risk | $500–$1,500 | Use reputable QI, set reminders |
| Depreciation Recapture | 25% flat tax on depreciation | 25% of depreciation claimed | Defer with 1031, but not eliminate |
| State Tax | Varies by state | 0%–13.3% | Move to no-tax state before sale |
| Installment Sale | Interest on deferred tax | Varies | Use 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.
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.
You qualify for the $250,000 exclusion. Taxable gain: $0. Tax owed: $0. No action needed beyond filing Form 8949.
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.
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.
| Feature | Section 121 Exclusion | 1031 Exchange |
|---|---|---|
| Control | Full — you keep the cash | Limited — funds held by QI |
| Setup time | None — automatic | 45 days to identify, 180 to close |
| Best for | Homeowners with gain under $250k/$500k | Investors who want to upgrade properties |
| Flexibility | High — any property type | Low — must be like-kind |
| Effort level | Low — just file | High — 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.
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.
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 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
⚡ Takes 2 minutes · No credit check · 100% free