Capital Gains Tax on Real Estate: How to Calculate, Reduce & Avoid It in 2026
Selling property can trigger a significant tax bill. Between federal capital gains tax, the Net Investment Income Tax, depreciation recapture, and state taxes, the total bite can reach 30% or more of your profit if you are not strategic. But the tax code also provides several powerful exclusions and deferrals — including the ability to sell your primary residence completely tax-free up to $500,000 in profit.
This guide covers every aspect of capital gains tax on real estate: how to calculate your gain, the tax rates that apply, and every legal strategy to reduce or eliminate what you owe.
How to Calculate Capital Gains on Real Estate
Your capital gain is not simply the sale price minus the purchase price. The IRS uses "adjusted basis" — a number that accounts for your original cost, improvements, depreciation, and selling expenses.
Capital Gain = Sale Price - Selling Costs - Adjusted Basis
Calculating Your Adjusted Basis
Adjusted Basis = Purchase Price + Closing Costs (at purchase) + Capital Improvements - Depreciation Taken
What Increases Your Basis (Reduces Your Taxable Gain)
- Original purchase price
- Closing costs at purchase: title insurance, attorney fees, recording fees, transfer taxes, survey costs
- Capital improvements: additions (new room, deck, garage), new roof, new HVAC system, kitchen or bathroom remodel, new windows, landscaping, driveway paving, electrical or plumbing upgrades
- Special assessments: costs for local improvements like sidewalks or sewer lines
What Does NOT Increase Your Basis
- Routine maintenance and repairs (painting, fixing leaks, patching drywall)
- Homeowner's insurance premiums
- Property taxes (deducted annually, not added to basis)
- Mortgage interest
Worked Example
James and Maria bought their home in 2016 for $320,000. Over 10 years they made improvements:
- Purchase closing costs: $8,500
- New roof (2019): $14,000
- Kitchen remodel (2021): $35,000
- New HVAC system (2023): $9,500
- Bathroom renovation (2024): $18,000
Adjusted basis: $320,000 + $8,500 + $14,000 + $35,000 + $9,500 + $18,000 = $405,000
They sell in 2026 for $625,000 with $37,500 in selling costs (6% agent commission).
Capital gain: $625,000 - $37,500 - $405,000 = $182,500
Estimate your gain with our Capital Gains Tax Calculator.
The Primary Residence Exclusion: Up to $500,000 Tax-Free
Section 121 of the Internal Revenue Code provides the most generous capital gains exclusion in the tax code:
- Single filers: Exclude up to $250,000 of gain
- Married filing jointly: Exclude up to $500,000 of gain
Qualification Requirements
To claim the full exclusion, you may want to meet all of these tests:
- Ownership test: You owned the home for at least 2 of the last 5 years before the sale.
- Use test: You lived in the home as your primary residence for at least 2 of the last 5 years (does not need to be consecutive).
- Frequency test: You have not excluded gain from the sale of another home in the last 2 years.
James and Maria from the example above are married and have lived in their home for 10 years. Their $182,500 gain is well under the $500,000 exclusion. They owe zero federal capital gains tax.
Partial Exclusion
If you do not meet the full 2-year requirement due to a change in employment, health reasons, or unforeseen circumstances, you can claim a partial exclusion. The exclusion is prorated based on the time you lived in the home.
Example: A single person lives in their home for 14 months (out of the required 24) before selling due to a job relocation. Partial exclusion: (14/24) x $250,000 = $145,833.
Capital Gains Tax Rates on Real Estate in 2026
If your gain exceeds the primary residence exclusion (or if the property is not your primary residence), the gain is taxed based on how long you owned the property:
Short-Term Capital Gains (Held Less Than 1 Year)
Taxed as ordinary income at your marginal tax rate — 10% to 37% depending on your income. This rarely applies to real estate but can come into play with quick flips.
Long-Term Capital Gains (Held 1 Year or More)
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | Up to $48,475 | $48,476 - $533,400 | Over $533,400 |
| Married Filing Jointly | Up to $96,950 | $96,951 - $600,050 | Over $600,050 |
These brackets are based on your total taxable income, not just the real estate gain. If your other income is $80,000 (single filer) and your capital gain is $100,000, the first portion of the gain fills the 15% bracket, and any amount pushing you above $533,400 hits 20%.
Net Investment Income Tax (NIIT): Additional 3.8%
On top of capital gains tax, high-income taxpayers owe an additional 3.8% Net Investment Income Tax (NIIT) on the lesser of net investment income or modified AGI exceeding:
- $200,000 for single filers
- $250,000 for married filing jointly
This means the maximum federal rate on real estate capital gains is 20% + 3.8% = 23.8%. Add state taxes and the total can exceed 30%.
Depreciation Recapture: The Tax Many Landlords Forget
If you rented out the property and claimed depreciation deductions, the IRS "recaptures" that depreciation when you sell — at a flat rate of 25%.
Depreciation recapture applies even if you did not actually claim the deduction but were entitled to. The IRS assumes you took it.
Example
You bought a rental property for $300,000 (building value: $240,000, land: $60,000). Over 10 years, you depreciated $240,000 / 27.5 years = $8,727/year, for total depreciation of $87,273.
Your adjusted basis: $300,000 - $87,273 = $212,727.
You sell for $420,000 (minus $25,200 selling costs = $394,800 net).
- Total gain: $394,800 - $212,727 = $182,073
- Depreciation recapture portion: $87,273 taxed at 25% = $21,818
- Remaining gain: $94,800 taxed at 15% long-term capital gains rate = $14,220
- Total federal tax: $21,818 + $14,220 = $36,038
Analyze your investment property returns with the Investment Property ROI Calculator.
1031 Exchange: Deferring Capital Gains on Investment Property
The 1031 exchange (named after Section 1031 of the IRC) allows you to defer all capital gains taxes when you sell an investment property — as long as you reinvest the proceeds into a "like-kind" property.
Key Rules
- Like-kind requirement: Must be real estate for real estate. A rental property can be exchanged for commercial property, raw land, or another rental. Personal residences do not qualify.
- 45-day identification period: You may want to identify potential replacement properties within 45 days of selling.
- 180-day closing deadline: You may want to close on the replacement property within 180 days.
- Qualified intermediary required: A third-party intermediary must hold the sale proceeds. You can never take possession of the money.
- Equal or greater value: To defer 100% of the gain, the replacement property must be equal to or greater in value, and you may want to reinvest all of the equity.
- Debt replacement: The mortgage on the new property must be equal to or greater than the mortgage on the sold property (or you invest additional cash).
1031 Exchange Example
You sell a rental condo for $400,000 with a $180,000 gain. Without a 1031 exchange, you owe approximately $36,000 in taxes (including depreciation recapture). With a 1031 exchange into a $500,000 rental house, you defer the entire $36,000. The deferred gain transfers to the new property's basis, meaning you may eventually owe it — unless you do another 1031 exchange, or hold until death (receiving a step-up in basis).
Step-Up in Basis: The Inherited Property Advantage
When you inherit property, your cost basis is "stepped up" to the fair market value on the date of the original owner's death. This can eliminate decades of capital gains.
How It Works
Your parents bought a house in 1985 for $80,000. When they pass away in 2026, the house is worth $550,000. If they had sold it themselves, their gain would be $470,000. But when you inherit it, your basis is $550,000 — the current market value.
If you sell the inherited house for $570,000, your taxable gain is only $20,000 ($570,000 - $550,000), not $490,000.
This step-up in basis effectively eliminates all capital gains that accumulated during the original owner's lifetime. It is one of the most significant tax benefits in real estate.
Community Property States Get a Double Step-Up
In community property states (Arizona, California, Idaho, Louisiana, Nevada, New Mexico, Texas, Washington, Wisconsin), when one spouse dies, the surviving spouse gets a step-up on the entire property — not just the deceased spouse's half. This doubles the tax benefit.
State Capital Gains Taxes: The Hidden Cost
Federal capital gains tax is only part of the picture. Most states also tax capital gains — typically at their regular income tax rate:
| State | Capital Gains Rate | Notes |
|---|---|---|
| California | Up to 13.3% | Highest state rate; no preferential CG rate |
| New York | Up to 10.9% | Plus NYC tax up to 3.876% |
| New Jersey | Up to 10.75% | No preferential CG rate |
| Oregon | Up to 9.9% | No sales tax but high income tax |
| Minnesota | Up to 9.85% | No preferential CG rate |
| Texas | 0% | No state income tax |
| Florida | 0% | No state income tax |
| Nevada | 0% | No state income tax |
| Washington | 7% | New capital gains tax on gains over $250K (effective 2022) |
In California, the worst case combined rate is 20% (federal) + 3.8% (NIIT) + 13.3% (state) = 37.1% on real estate capital gains. That is more than a third of your profit.
Other Strategies to Reduce Real Estate Capital Gains Tax
Installment Sales
Instead of receiving the full sale price at closing, you can structure an installment sale where the buyer pays over multiple years. This spreads your capital gain across tax years, potentially keeping you in a lower bracket each year.
Example: You sell a rental property with a $200,000 gain. Taking it all in one year at the 15% rate costs $30,000. Spreading it over 4 years at $50,000/year might keep each installment in the 0% or 15% bracket depending on your other income.
Opportunity Zones
Investing capital gains into a Qualified Opportunity Fund (QOF) that invests in designated Opportunity Zones can defer and partially reduce capital gains. If you hold the QOF investment for 10 years or more, any appreciation in the Opportunity Zone investment is tax-free.
Convert to Primary Residence
If you own a rental or investment property and plan to sell, you can move into the property and make it your primary residence. After living there for 2 out of 5 years, you qualify for the Section 121 exclusion. However, gains attributable to "non-qualified use" periods (post-2008 rental periods) may not qualify for the exclusion.
Harvest Losses
Capital losses from other investments can offset capital gains from real estate. If you sold stocks at a loss, those losses directly reduce your real estate gain. You can also carry forward unused losses to future years.
Time the Sale for Lower Income Years
If you are planning to retire, get laid off, or take a sabbatical, selling in a year when your other income is low means your capital gain fills up lower tax brackets. This is especially effective for gains in the 0% long-term capital gains bracket.
Track your property's appreciation over time with the Home Appreciation Calculator.
Calculate Your Real Estate Capital Gains Tax
Every property sale is different. Our Capital Gains Tax Calculator factors in your holding period, filing status, income level, and applicable exclusions to calculate your exact tax liability. It handles the primary residence exclusion, long-term vs short-term rates, and the NIIT.
For investment properties, use the Investment Property ROI Calculator to see how capital gains tax affects your total return, and the Home Appreciation Calculatorto estimate your property's current value and potential gain before listing.