Key Takeaways
- You can exclude up to $250,000 in capital gains ($500,000 for married couples) when selling your primary residence if you lived in it for at least 2 of the past 5 years
- Short-term capital gains (property held less than one year) are taxed at ordinary income tax rates up to 37%, while long-term gains are taxed at preferential rates of 0%, 15%, or 20%
- Your cost basis is not just the purchase price — it includes closing costs, capital improvements (new roof, kitchen remodel, additions), and in some cases selling expenses, all of which reduce your taxable gain
- Strategies to minimize or defer real estate capital gains include the Section 121 exclusion, 1031 exchanges for investment properties, installment sales, and opportunity zone investments
What's your FI number? Calculate it in 60 seconds
The one number that changes everything
Real Estate Capital Gains at a Glance
How Close Are You to Financial Independence?
Free calculators, a personalized FI roadmap, and a community of 25K+ on the same journey.
Short-Term vs Long-Term Capital Gains on Real Estate
The amount of tax you owe on a real estate sale depends primarily on how long you held the property. This single factor — your holding period — determines whether you pay ordinary income tax rates or the lower long-term capital gains rates.
Short-Term Capital Gains (Held 1 Year or Less)
If you sell a property you have owned for one year or less, the profit is taxed as short-term capital gains at your ordinary income tax rate. For high earners, this can mean paying 32% to 37% federal tax on the gain, plus state income tax. Short-term gains are the most expensive way to realize real estate profits, which is why house flippers face a significantly higher tax burden than long-term investors.
Long-Term Capital Gains Rates (Held More Than 1 Year)
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | Up to $47,025 | $47,026 – $518,900 | Over $518,900 |
| Married Filing Jointly | Up to $94,050 | $94,051 – $583,750 | Over $583,750 |
| Head of Household | Up to $63,000 | $63,001 – $551,350 | Over $551,350 |
These rates apply to taxable income after deductions, not gross income. Many FI retirees who have left traditional employment find themselves in the 0% or 15% long-term capital gains bracket — one of the most powerful tax advantages of early retirement.
The Net Investment Income Tax (NIIT)
In addition to the capital gains rate, high-income taxpayers owe an additional 3.8% Net Investment Income Tax on investment income (including real estate gains) when modified AGI exceeds $200,000 (single) or $250,000 (married filing jointly). This brings the maximum effective federal rate on long-term real estate gains to 23.8%.
Real Example: The Tax Difference
Suppose you bought a rental property for $300,000, made $50,000 in improvements, and sold it for $500,000. Your gain is $150,000.
- Short-term (held < 1 year), 32% bracket: $48,000 in federal tax
- Long-term (held > 1 year), 15% bracket: $24,500 in federal tax
- Savings from holding more than one year: $25,500
This is why timing matters enormously in real estate. Holding a property for just one additional day — crossing the one-year threshold — can save you tens of thousands of dollars.
The Primary Residence Exclusion (Section 121)
The Section 121 exclusion is the single most valuable tax benefit in real estate. If you sell your primary residence and meet the ownership and use tests, you can exclude up to $250,000 in capital gains from taxation ($500,000 for married couples filing jointly). This is not a deduction — it is a complete exclusion. The gain simply does not exist for tax purposes.
The Two-of-Five-Year Rule
To qualify, you must have owned AND used the home as your primary residence for at least 2 of the 5 years before the sale. The two years do not need to be consecutive. You can use this exclusion once every two years.
This rule creates powerful planning opportunities for FI-focused homeowners. If you bought a home, lived in it for two years, converted it to a rental for up to three years, and then sold it, you could still qualify for the exclusion because you used it as your primary residence for 2 of the past 5 years.
How to Calculate Your Cost Basis
Your capital gain is not simply the sale price minus the purchase price. The IRS allows you to add several costs to your basis, which reduces your taxable gain.
| Adds to Your Basis (Reduces Gain) | Does NOT Add to Basis |
|---|---|
| Original purchase price | Routine maintenance and repairs |
| Closing costs at purchase (title, legal, recording fees) | Homeowner's insurance premiums |
| Capital improvements (new roof, HVAC, addition, remodel) | Utility costs |
| Assessments for local improvements (sidewalks, sewers) | Landscaping maintenance |
| Selling expenses (agent commissions, transfer taxes) | Furniture and personal property |
Basis Calculation Example
- Purchase price: $280,000
- Closing costs at purchase: $8,000
- Kitchen renovation: $35,000
- New roof: $15,000
- Bathroom addition: $22,000
- Adjusted basis: $360,000
If you sell for $700,000:
- Gross gain: $700,000 - $360,000 = $340,000
- Less selling expenses (6% commission + fees): $44,000
- Net gain: $296,000
- Married filing jointly exclusion: $500,000
- Taxable gain: $0
Keep every receipt for capital improvements. A $35,000 kitchen remodel receipt from 2015 could save you $5,250 or more in capital gains tax when you sell.
Strategies to Minimize or Defer Real Estate Capital Gains Tax
Beyond the primary residence exclusion, several strategies allow real estate investors to reduce, defer, or eliminate capital gains tax on property sales.
1031 Exchange (Like-Kind Exchange)
A 1031 exchange allows you to sell an investment property and defer all capital gains tax by reinvesting the proceeds into a "like-kind" replacement property. The rules are strict:
- 45-day identification period: You must identify potential replacement properties within 45 days of selling
- 180-day closing deadline: You must close on the replacement property within 180 days
- Equal or greater value: The replacement property must be equal to or greater in value than the property sold
- Qualified intermediary required: A third-party intermediary must hold the sale proceeds; you cannot touch the money
- Investment property only: Your primary residence does not qualify; both properties must be held for investment or business use
A 1031 exchange does not eliminate the tax — it defers it. If you eventually sell the replacement property without doing another exchange, you owe tax on the accumulated gain from all prior exchanges. However, many investors execute a series of 1031 exchanges throughout their careers and eventually pass the properties to heirs, who receive a stepped-up basis that effectively eliminates the deferred gains.
Depreciation Recapture for Rental Properties
If you have been depreciating a rental property (as required by the IRS), the depreciation you claimed is "recaptured" at sale and taxed at your ordinary income tax rate, up to a maximum of 25%. If your marginal tax rate is below 25% (for example, 12% or 22%), you pay that lower rate on the recaptured depreciation — the 25% is a ceiling, not a flat rate. This is separate from and in addition to regular capital gains tax.
| Component | Tax Rate | Example ($100K Total Gain) |
|---|---|---|
| Depreciation recapture | Ordinary rate, up to 25% max | $40,000 depreciation × up to 25% = up to $10,000 |
| Remaining long-term gain | 0%, 15%, or 20% | $60,000 gain x 15% = $9,000 |
| Total tax | Blended | $19,000 |
Other Strategies
Installment Sale (Section 453): Spread the gain over multiple years by receiving payments from the buyer over time. This can keep you in a lower tax bracket each year and is especially useful for large gains that would push you into the 20% capital gains bracket or trigger the 3.8% NIIT.
Opportunity Zone Investment: Invest capital gains into a Qualified Opportunity Zone Fund within 180 days of realizing the gain. You can defer the original gain until 2026 and potentially exclude gains on the new investment if held for 10+ years.
Convert to Primary Residence: If you own a rental property with significant appreciation, move into it and make it your primary residence for at least 2 years. You can then sell and use the Section 121 exclusion. Note: gains attributable to periods of non-qualified use (rental use after 2008) are not eligible for the exclusion.
Harvest Losses: If you have other investments with unrealized losses, sell them in the same year as your profitable real estate sale. Capital losses offset capital gains dollar-for-dollar, and up to $3,000 in excess losses can offset ordinary income.
Top Travel Card
Ready to unlock a world of free travel? Start with the Chase Sapphire Preferred® Card
$95 annual fee | Earn 75,000 bonus points
Best Card for Side Hustlers and Business Owners
Side hustlers! With the Ink Business Preferred® Credit Card you can earn free travel from your business expenses.
$95 annual fee | Earn 100,000 bonus points
Most Flexible Travel Card
The Capital One Venture Rewards Credit Card can be used to offset almost any travel expense.
$95 annual fee | Earn more than $1,000 in Travel Bonuses with a limited-time $300 Capital One Travel stays credit, plus earn 75,000 bonus miles once you spend $4,000 on purchases within the first 3 months of account opening—that's more than $1,000 in travel value
ChooseFI has partnered with CardRatings for our coverage of credit card products. ChooseFI and CardRatings may receive a commission from card issuers.
How to Calculate Capital Gains Tax on a Real Estate Sale
Follow these steps to determine your tax liability before selling.
Determine Your Adjusted Cost Basis
Start with your original purchase price. Add closing costs from the purchase, all capital improvements made during ownership, and any assessments for local improvements. Subtract any depreciation claimed on rental property. The result is your adjusted basis.
Calculate Your Net Gain
Subtract your adjusted basis from the net sale price (sale price minus selling expenses like real estate commissions, transfer taxes, and closing costs). The result is your capital gain.
Apply the Primary Residence Exclusion (If Eligible)
If the property was your primary residence and you lived in it for at least 2 of the past 5 years, exclude up to $250,000 ($500,000 married filing jointly) from the gain. If your gain is below the exclusion amount, you owe zero capital gains tax.
Determine Your Holding Period and Tax Rate
If you held the property for more than one year, long-term capital gains rates (0%, 15%, or 20%) apply based on your taxable income. If held for one year or less, short-term rates (your ordinary income tax rate) apply. Add 3.8% NIIT if your MAGI exceeds $200,000 single or $250,000 married.
Account for Depreciation Recapture (Rental Properties)
If you claimed depreciation on a rental property, the total depreciation is recaptured and taxed at your ordinary income tax rate (up to a maximum of 25%) when you sell. Calculate this separately from the remaining capital gain, which is taxed at your applicable long-term capital gains rate.
Frequently Asked Questions
The most common way is the Section 121 primary residence exclusion. If you owned and lived in the home for at least 2 of the past 5 years, you can exclude up to $250,000 in gains ($500,000 for married couples). For gains exceeding the exclusion, strategies include installment sales to spread the gain over multiple tax years, opportunity zone investments to defer and potentially reduce the gain, or selling in a year when your other income is low to qualify for the 0% long-term capital gains rate.
Inherited property receives a "stepped-up basis" to the fair market value on the date of the decedent's death. This means if your parent bought a house for $100,000 and it was worth $400,000 when they died, your basis is $400,000 — not $100,000. If you sell for $410,000, your taxable gain is only $10,000. This stepped-up basis is one of the most significant tax benefits in the U.S. tax code.
If you claimed depreciation deductions on a rental property, the IRS "recaptures" that depreciation when you sell and taxes it at your ordinary income tax rate, up to a maximum of 25%. For example, if you depreciated $60,000 over your ownership period and your marginal tax rate is 25% or higher, you would owe $15,000 in depreciation recapture tax at sale (someone in the 12% bracket would owe $7,200 instead), in addition to any capital gains tax on the remaining profit. A 1031 exchange can defer depreciation recapture as well as capital gains.
No. A 1031 exchange applies only to property held for investment or business use. Your primary residence does not qualify. However, a hybrid strategy exists: convert your primary residence to a rental property, operate it as a rental for at least one to two years, then do a 1031 exchange into a new investment property. Consult a tax professional before attempting this, as the rules are complex.
It depends on your state. Most states tax capital gains as ordinary income. Nine states have no income tax (Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, Wyoming), so no state capital gains tax applies. Some states like California tax capital gains at rates up to 13.3%. The state where the property is located and the state where you reside may both claim taxing authority.
You must own AND use the home as your primary residence for at least 2 out of the 5 years before the sale to qualify for the Section 121 exclusion. The 2 years do not need to be consecutive, and you can use this exclusion once every 2 years. Partial exclusions are available if you moved due to a change in employment, health, or certain unforeseen circumstances before meeting the 2-year requirement.
The Bottom Line
Capital gains tax on real estate can take a significant bite out of your profits — but the tax code provides powerful tools to reduce, defer, or eliminate it. The Section 121 exclusion ($250K single / $500K married) makes selling a primary residence tax-free for most homeowners. For investment properties, 1031 exchanges defer gains indefinitely, and strategies like installment sales, opportunity zones, and loss harvesting provide additional options. The key for FI-focused real estate investors is planning: track your cost basis meticulously, time your holding periods to qualify for long-term rates, and consult a tax professional before selling high-value properties. Real estate remains one of the most tax-advantaged asset classes when you understand and use the rules strategically.
Section 121 Exclusion (MFJ)
$500,000
Long-Term Max Rate
20% + 3.8%
Max Depreciation Recapture Rate
25%