When you sell a home or investment property, the IRS may tax the profit as a capital gain. How much you owe — or whether you owe anything at all — depends on how long you owned the property, how you used it, and your total taxable income. Most homeowners who sell a primary residence end up paying little or nothing in capital gains tax because of a generous federal exclusion, but investors and people selling second homes face a different picture.

For a broader view of how capital gains work before diving into real estate specifics, see the capital gains tax rates guide and the capital gains tax guide.

Primary Residence Exclusion

The primary residence exclusion under IRS Section 121 is the biggest tax break available to homeowners. It lets most sellers exclude a substantial chunk of their gain entirely, which is why the majority of people who sell a long-held home owe no federal capital gains tax at all.

If your home is your primary residence, you may exclude a significant gain from taxes:

Filing Status Maximum Exclusion
Single $250,000
Married Filing Jointly $500,000

Requirements

The two-year ownership and use test does not have to be continuous. You simply need to have owned the home and lived in it as your primary residence for a combined total of at least 24 months out of the 60 months before the sale. The 60-month window gives sellers flexibility if they moved temporarily for work or family reasons.

Requirement Details
Ownership Owned for 2+ of last 5 years
Residence Lived there 2+ of last 5 years
Frequency Haven’t used exclusion in past 2 years
Documentation Keep records of purchase and improvements

Example: Primary Residence

This example shows how improvement costs reduce your taxable gain by increasing your cost basis. Every dollar you can add to your basis is a dollar that is not taxed. See the cost basis guide for a full breakdown of what counts.

Item Amount
Original purchase price $300,000
Cost of improvements $50,000
Cost basis $350,000
Sale price $550,000
Selling costs $33,000
Net proceeds $517,000
Capital gain $167,000
Exclusion (married) $500,000
Taxable gain $0

When You Owe Capital Gains Tax

There are three common situations where a home sale does trigger a tax bill: the gain exceeds the exclusion limit, you have not met the two-year residency test, or the property was never your primary residence. Investors who flip homes quickly should also note that gains on properties held less than one year are treated as short-term and taxed at ordinary income rates — not the lower long-term rates.

Exceeding the Exclusion

Married couple, gained $600,000:

Item Amount
Total gain $600,000
Exclusion -$500,000
Taxable gain $100,000
Tax (at 15% rate) $15,000

Not Meeting Requirements

Situation Tax Treatment
Lived there < 2 years Partial exclusion possible*
Investment property Full gain taxable
Rental property Full gain taxable
Flipped (< 1 year) Short-term rates

*Partial exclusion if moved for work, health, or unforeseen circumstances

Capital Gains Tax Rates

The rate that applies to your taxable real estate gain depends on how long you held the property and your total income for the year. Long-term rates are meaningfully lower than short-term rates, which is why holding period planning matters even for investment properties. The full bracket breakdown by filing status is on the capital gains tax rates page.

Long-Term (Held Over 1 Year)

2026 Taxable Income (Single) Rate
$0 - $48,350 0%
$48,350 - $533,400 15%
Over $533,400 20%
2026 Taxable Income (Married) Rate
$0 - $96,700 0%
$96,700 - $600,050 15%
Over $600,050 20%

Short-Term (Held Under 1 Year)

Taxed as ordinary income (10%-37% depending on bracket)

Net Investment Income Tax

High earners may also owe 3.8% NIIT on investment income above the thresholds below. This surtax stacks on top of the regular long-term rate, meaning a high-income investor can face an effective rate of up to 23.8% on a long-term gain. See the net investment income tax guide for more detail.

  • Single: Income over $200,000
  • Married: Income over $250,000

Calculating Capital Gains

Your taxable gain is not simply the sale price minus what you originally paid. You can add improvement costs, certain closing costs, and selling expenses to your cost basis, which reduces the gain. Getting this right can mean the difference between owing tax and owing nothing. Use our capital gains calculator to run the numbers for your situation.

Step-by-Step

Sale Price
- Selling Costs (commissions, fees)
= Net Proceeds

Original Purchase Price
+ Closing Costs (when bought)
+ Capital Improvements
+ Selling Costs (when sold)
= Adjusted Cost Basis

Net Proceeds - Adjusted Cost Basis = Capital Gain

What Counts as Cost Basis

Included Not Included
Purchase price Furniture
Closing costs (buy) Repairs/maintenance
Major improvements Insurance premiums
Assessments Property taxes
Legal fees Utility costs

Common Improvements to Track

Improvement Adds to Basis?
Kitchen remodel Yes
Room addition Yes
New roof Yes
New HVAC Yes
Landscaping Yes (permanent)
Painting Usually no (maintenance)
Appliances Usually no

Investment Property Tax Rules

If you rent out a property or use it primarily as an investment, the rules are stricter. There is no Section 121 exclusion available, and you also have to contend with depreciation recapture — a separate tax on the deductions you took while you owned the property.

Investment properties don’t qualify for the primary residence exclusion:

Example: Rental Property

Item Amount
Purchase price $200,000
Improvements $30,000
Depreciation claimed -$50,000
Adjusted basis $180,000
Sale price $350,000
Selling costs -$21,000
Net proceeds $329,000
Capital gain $149,000

Depreciation Recapture

Depreciation recapture is one of the most overlooked costs of selling a rental property. When you take depreciation deductions during ownership, the IRS treats those deductions as having reduced your cost basis. At sale, it “recaptures” those amounts and taxes them at a flat 25% rate, separate from the standard capital gains rate on the rest of your gain. See the depreciation recapture guide for a deeper explanation and planning strategies.

Type Tax Rate
Depreciation recapture 25%
Remaining gain (long-term) 0/15/20%

Using example above:

Component Amount Tax Rate Tax
Depreciation recapture $50,000 25% $12,500
Remaining gain $99,000 15% $14,850
Total tax $27,350

Strategies to Reduce Capital Gains

Real estate investors have more tools available than most taxpayers to reduce or defer a capital gains bill. These strategies range from the widely used 1031 exchange to the less-known opportunity zone deferral. The right approach depends on whether you want to defer the tax, reduce it now, or eliminate it entirely with a primary residence conversion.

1031 Exchange

Defer taxes by exchanging for another investment property:

Requirement Details
Property type Like-kind (investment for investment)
Timeline 45 days to identify, 180 days to close
Value Must be equal or greater value
Primary residence Not eligible

Installment Sale

Spread the gain over multiple years:

  • Receive payments over time
  • Report gains as received
  • May lower annual tax bracket

Opportunity Zones

Invest gains in designated opportunity zones — see the opportunity zones guide for eligibility rules and current program status:

  • Defer original gain until 2026
  • Reduce gain by 10% if held 5+ years
  • Exclude gains on new investment if held 10+ years

Convert to Primary Residence

  • Move into rental for 2+ years before selling
  • Qualify for primary residence exclusion
  • Note: Rules limit exclusion for properties previously rented

State Capital Gains Taxes

Federal taxes are only part of the picture. Most states also tax capital gains, and the rates can be significant. A few states have no capital gains tax at all, which makes them popular destinations for retirees planning large property sales.

State Rate
No state capital gains tax AK, FL, NV, NH*, SD, TN*, TX, WA*, WY
California Up to 13.3%
New York Up to 8.82%
New Jersey Up to 10.75%
Most states Taxed as income

*Some states tax only dividends/interest, not all capital gains

Record-Keeping Checklist

Good records reduce your tax bill on a home sale because every documented improvement cost adds to your basis and reduces the taxable gain. Keep everything from both the purchase and the sale, and hold onto records longer than you think you need to. The IRS generally has three years to audit a return, but basis errors on property can be challenged much later if the records are missing.

Keep these documents for tax purposes:

Document Purpose
Settlement statement (buy) Proves cost basis
Improvement receipts Adds to basis
Settlement statement (sell) Proves sale price
Mortgage statements Documents costs
Depreciation records For rentals
1099-S form Reports sale to IRS

Keep records for at least 3 years after filing (7 years recommended)

Related: Capital Gains Tax Rates | Capital Gains Calculator | Depreciation Recapture Tax | Net Investment Income Tax | Opportunity Zones Guide | How to Avoid Capital Gains Tax

WealthVieu
Written by WealthVieu

WealthVieu researches and writes data-driven personal finance guides using primary sources including the IRS, Bureau of Labor Statistics, Federal Reserve, and Census Bureau.

The content on Wealthvieu is for informational purposes only and should not be considered financial, tax, or investment advice. Consult a qualified professional before making financial decisions. Full disclaimer · Editorial policy