Skip to main content
Share:

Home Sale Tax Calculator — Capital Gains on Property 2026

Free home sale tax calculator for 2026. Calculate capital gains tax on the sale of your home, rental property, or second home. Includes $250K/$500K exclusion, cost basis, and depreciation recapture. No sign-up.

When you sell your home, you may owe capital gains tax on the profit. If it's your primary residence and you've lived in it for at least 2 of the last 5 years, you can exclude up to $250,000 (single) or $500,000 (married) of the gain. Any remaining gain is taxed at long-term capital gains rates of 0%, 15%, or 20%, plus a 3.8% Net Investment Income Tax if your income is high enough. Rental properties are subject to depreciation recapture at 25%.

Last reviewed: February 2026 · By Rachel Mitchell, CPA · Information verified against IRS.gov & IRC Section 121

Home Sale Tax Quick Summary

Primary Residence Exclusion

$250K / $500K

$250,000 for single filers, $500,000 for married filing jointly. Must live in home 2 of last 5 years.

Long-Term Capital Gains Rate

0% / 15% / 20%

Plus 3.8% NIIT for high earners. Rate depends on your taxable income level.

Depreciation Recapture

25%

On accumulated depreciation for rental properties. Taxed regardless of your income bracket.

Home Sale Capital Gains Tax Calculator

Enter your home sale details to estimate your capital gains tax. All calculations follow IRS rules for 2026.

Additions, renovations, new roof, etc. (not repairs)

Real estate commissions, closing costs, transfer taxes

Need 24+ months for full exclusion. 0–60 range.

How Capital Gains Tax on a Home Sale Works — Complete Guide

When you sell a home for more than you paid for it, the profit is a capital gain. The IRS taxes this gain, but several exclusions and rules can reduce or eliminate the tax. The biggest break is the Section 121 primary residence exclusion, which lets you exclude up to $250,000 (single) or $500,000 (married filing jointly) of the gain if you meet certain conditions.

The tax you owe depends on three main factors: (1) whether the home was your primary residence, a rental, or a second home; (2) how long you owned it (short-term vs. long-term); and (3) your overall taxable income, which determines your capital gains rate. Understanding these factors is key to calculating your tax accurately.

Primary residence exclusion (Section 121): 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 2 years don't need to be consecutive — you just need 24 months total. You can only use this exclusion once every 2 years. If you're married filing jointly, both spouses must meet the residency requirement, but only one needs to meet the ownership requirement.

Cost basis calculation: Your cost basis isn't just the purchase price. It's the purchase price plus capital improvements minus any depreciation you claimed. Capital improvements are projects that add value, prolong the home's life, or adapt it to a new use — think new roof, room addition, or major kitchen renovation. Repairs and maintenance (painting, fixing leaks) don't count. Selling costs like real estate commissions and closing fees also reduce your gain.

Short-term vs. long-term capital gains: If you owned the home for more than one year, the gain is long-term and taxed at preferential rates (0%, 15%, or 20%). If you owned it for one year or less, it's short-term and taxed at your ordinary income rate — which can be significantly higher. Most home sales involve long-term gains since people typically own homes for years.

Net Investment Income Tax (NIIT): If your modified adjusted gross income (MAGI) exceeds $200,000 (single) or $250,000 (MFJ), you may owe an additional 3.8% tax on your capital gains. This tax applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold. It stacks on top of the regular capital gains rate.

Step-by-Step: How to Calculate Capital Gains on a Home Sale

1

Determine your cost basis

Start with the original purchase price, add the cost of capital improvements (new roof, room additions, major renovations), and subtract any depreciation you claimed (or could have claimed) on the property. This is your adjusted cost basis.

2

Subtract cost basis from sale price

Take the sale price and subtract your adjusted cost basis and selling costs (real estate commissions, title insurance, transfer taxes, and other closing costs). The result is your total capital gain.

3

Apply the primary residence exclusion

If the home was your primary residence and you lived there for at least 24 of the last 60 months, subtract $250,000 (single) or $500,000 (MFJ). If you lived there less than 24 months but qualify for a partial exclusion, prorate based on months lived.

4

Calculate tax on the remaining gain

Apply the appropriate long-term capital gains rate to the taxable gain: 0% if your taxable income is below ~$47K (single) / ~$94K (MFJ), 15% up to ~$518K / ~$583K, or 20% above those thresholds. Add 3.8% NIIT if your MAGI exceeds $200K / $250K.

5

Add depreciation recapture tax

If the property was ever rented out and you claimed depreciation, multiply the accumulated depreciation by 25%. Add this to your capital gains tax. The total is your overall tax on the sale.

Primary Residence Exclusion Rules (Section 121)

The Section 121 exclusion is the single most important tax break for home sellers. Here are the rules you need to know:

Exclusion Amounts

  • $250,000 for single filers
  • $500,000 for married filing jointly
  • • Married couples: both must meet residency test
  • • Only one spouse needs to meet ownership test

Qualification Requirements

  • • Own and use as primary residence for 2 of 5 years
  • • The 2 years don't need to be consecutive
  • • Can only use exclusion once every 2 years
  • • Must report sale even if gain is fully excluded

Partial Exclusion

  • • Available if move due to health, job, or unforeseen events
  • • Prorated: (months lived / 24) × full exclusion
  • • IRS Safe Harbors: move >50 miles for work
  • • Also: divorce, death of spouse, multiple births

Does NOT Apply To

  • • Rental properties (never your primary residence)
  • • Vacation / second homes
  • • Home flipped in under 1 year
  • • Property held in a corporation or trust

Rental Property & Second Home Sales

Selling a rental property or second home is very different from selling your primary residence. Here's what you need to know:

Depreciation recapture at 25%: When you sell a rental property, all the depreciation you claimed (or were entitled to claim) over the years is "recaptured" and taxed at a flat 25% rate. This is separate from the regular capital gains tax. For example, if you claimed $50,000 in depreciation over 10 years, you'll owe $12,500 in recapture tax, regardless of your income bracket. This is reported on Form 4797.

No primary residence exclusion for pure rentals: If the property was always a rental and never your primary residence, you cannot use the Section 121 exclusion. The entire gain is taxable. However, the gain above the depreciation recapture amount is still taxed at the more favorable long-term capital gains rates.

1031 exchange option: Instead of paying tax on the sale of a rental property, you can defer the gain by doing a 1031 like-kind exchange. You must identify a replacement property within 45 days and close within 180 days. The replacement property must be an investment or business property — not a personal residence. This defers the tax; it doesn't eliminate it. When you eventually sell without a 1031 exchange, you'll owe tax on the accumulated gain.

Converting rental to primary residence: If you move into your rental property and use it as your primary residence for at least 2 of the 5 years before selling, you may qualify for the Section 121 exclusion. However, the IRS has a 5-year look-back rule: any period after 2008 where the property was not your primary residence ("non-qualified use") reduces the exclusion proportionally. The depreciation recapture still applies regardless.

Capital Gains Tax Rates for 2026

Long-term capital gains (assets held more than one year) are taxed at preferential rates based on your taxable income. Here are the thresholds for 2026:

RateSingleMarried Filing Jointly
0%Up to ~$47,000Up to ~$94,000
15%~$47,000 to ~$518,000~$94,000 to ~$583,000
20%Over ~$518,000Over ~$583,000

+ 3.8% NIIT for high earners: If your MAGI exceeds $200,000 (single) or $250,000 (MFJ), the Net Investment Income Tax adds 3.8% on top of your capital gains rate. So the effective maximum rate is 23.8% (20% + 3.8%). This applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold.

Short-term capital gains (property held one year or less) are taxed at ordinary income rates, which range from 10% to 37%. There is no preferential treatment for short-term gains. This is why holding a property for more than one year before selling is so important for tax purposes.

Home Sale Tax — Key Data for 2026

Primary Residence Exclusion (Single)

$250,000

Primary Residence Exclusion (MFJ)

$500,000

Long-Term Capital Gains Rate

0% / 15% / 20%

Depreciation Recapture Rate

25%

NIIT Rate

3.8%

Residency Test

2 of 5 years

0% Rate Threshold (Single)

~$47,000 taxable income

0% Rate Threshold (MFJ)

~$94,000 taxable income

Home Sale Tax Calculator FAQ

How much capital gains tax will I pay when I sell my house?

It depends on your profit, filing status, and how long you lived in the home. If it's your primary residence and you meet the 2-of-5-year test, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) of the gain. Any remaining gain is taxed at long-term capital gains rates: 0%, 15%, or 20%, depending on your taxable income. High earners may also pay an additional 3.8% Net Investment Income Tax (NIIT).

What is the Section 121 primary residence exclusion?

Section 121 of the Internal Revenue Code lets you exclude up to $250,000 of capital gains from the sale of your primary residence if you're single, or $500,000 if married filing jointly. 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. You can only use this exclusion once every 2 years.

What if I don't meet the 2-of-5-year residency test?

If you don't meet the full 2-year residency requirement, you may qualify for a partial exclusion if the sale was due to a change in employment, health reasons, or unforeseen circumstances (like divorce or natural disaster). The partial exclusion is prorated based on the time you lived in the home. For example, if you lived there 1 year out of 5, you'd get half the exclusion: $125,000 (single) or $250,000 (MFJ).

How is cost basis calculated for a home sale?

Your cost basis is the original purchase price of the home plus the cost of capital improvements (not repairs or maintenance) minus any depreciation claimed. Capital improvements include things like a new roof, room addition, or major renovation. Routine repairs like painting or fixing a leaky faucet don't count. The higher your cost basis, the lower your capital gain.

What is depreciation recapture on a rental property sale?

When you sell a rental property, you must "recapture" the depreciation you claimed (or could have claimed) over the years. This recaptured depreciation is taxed at a flat 25% rate, not at the regular capital gains rate. This applies even if you didn't actually claim depreciation on your tax returns — the IRS treats it as "allowed or allowable." Depreciation recapture is reported on Form 4797 and Schedule D.

Do I pay capital gains tax if I sell my house at a loss?

If you sell your primary residence at a loss, you generally cannot deduct the loss on your tax return. The IRS does not allow you to claim a capital loss on the sale of a personal residence. However, if the property was a rental or investment property, you may be able to deduct the loss as a capital loss, subject to the usual capital loss limitations ($3,000 per year against ordinary income, with carryforward).

What is the 3.8% Net Investment Income Tax (NIIT)?

The NIIT is an additional 3.8% tax on investment income (including capital gains from home sales) that applies to high-income taxpayers. It kicks in when your modified adjusted gross income (MAGI) exceeds $200,000 (single) or $250,000 (married filing jointly). The tax applies to the lesser of your net investment income or the amount your MAGI exceeds the threshold. This is on top of the regular capital gains tax.

Can I avoid capital gains tax with a 1031 exchange?

A 1031 exchange (like-kind exchange) lets you defer capital gains tax by reinvesting the proceeds from the sale of an investment or rental property into a similar property. Important: 1031 exchanges do NOT apply to primary residences — only to investment and business properties. You must identify a replacement property within 45 days and close within 180 days. This defers the tax, it doesn't eliminate it permanently.

What counts as a capital improvement vs. a repair?

Capital improvements add to your cost basis and include projects that add value, prolong the home's life, or adapt it to a new use — like adding a room, installing central air, replacing the roof, or finishing a basement. Repairs maintain the home in good condition but don't add value — like fixing a leak, repainting, or replacing a broken window. Only capital improvements increase your cost basis; repairs do not.

How does selling a second home differ from a primary residence?

Second homes (vacation homes) do not qualify for the Section 121 primary residence exclusion — you'll pay capital gains tax on the entire gain. However, if you convert your second home to your primary residence and live in it for at least 2 of 5 years before selling, you may qualify for a partial exclusion (subject to the 5-year look-back rule for non-qualified use periods). The gain is still taxed at long-term capital gains rates.

What are the capital gains tax rates for 2026?

For 2026, long-term capital gains (assets held over 1 year) are taxed at three rates: 0% for taxable income up to roughly $47,000 (single) or $94,000 (MFJ), 15% for income up to roughly $518,000 (single) or $583,000 (MFJ), and 20% for income above those thresholds. Short-term gains (assets held 1 year or less) are taxed at ordinary income rates. The 3.8% NIIT applies on top for high earners.

Do I need to report the sale of my home to the IRS?

Yes, you must report the sale on your tax return using Schedule D and Form 8949, even if the entire gain is excluded under Section 121. If you receive a Form 1099-S (Proceeds from Real Estate Transactions), the IRS already knows about the sale, and failing to report it can trigger a notice. If no Form 1099-S was issued and the entire gain is excludable, you still need to report it, but you won't owe any tax.

Related Calculators

Link to This Calculator

Help others find this free tool — add a link to your website or blog.

<a href="https://thetaxcalc.com/home-sale-tax-calculator" title="Home Sale Tax Calculator 2026 — Capital Gains on Property">Home Sale Tax Calculator 2026 — Capital Gains on Property</a>
Rachel Mitchell, CPA
Rachel MitchellCPAVerified Expert

Lead Tax Analyst, TheTaxCalc

Rachel Mitchell is a Certified Public Accountant with over 12 years of experience in individual and small-business taxation. She specializes in federal and state income tax compliance, FICA optimization, and payroll tax strategy. Rachel holds an MS in Taxation from Golden Gate University and is an active member of the AICPA.

Reviewed: January 2026Tax data verified against IRS Publication 15-T & state revenue departments