★ MONEY · HOME SALE · GUIDE

How to Calculate Capital Gains Tax on a Home Sale: A Guide

On a $750,000 sale you owe $8,250.00 of tax — and keep $696,750.00. This guide works through the five steps — the gain, the exclusion, the 0/15/20% bands, the NIIT, and the total — with every number checked against the calculator.

What capital gains tax on a home sale is

Selling a home for more than you paid creates a capital gain — but a home you lived in gets a break first. Under IRC §121, if you owned the home and lived in it for at least 2 of the last 5 years, the first $250,000.00 of gain is excluded from tax entirely — $500,000.00 if you are married filing jointly. Only what is left is taxable, at 0%, 15% or 20%, on top of your other income. Five steps: the gain, the exclusion, the bands, the NIIT, and the total.

Step 1: Work out the total gain

The gain is the sale price minus your adjusted basis minus your selling costs. On a $750,000.00 sale with a $400,000.00 basis and $45,000.00 of selling costs, the gain is $305,000.00. Your basis is what you paid plus improvements. With a $500,000.00 basis the gain is only $205,000.00. With no selling costs the gain is $350,000.00. At a $445,000.00 sale price the gain is $0.00. At $400,000.00 it is -$45,000.00, a loss, and there is no tax at all.

Step 2: Take the exclusion

Subtract the exclusion from the gain. A single filer who lived in the home 2 of the last 5 years excludes $250,000.00, so the $305,000.00 gain leaves a taxable gain of $55,000.00. Married filing jointly excludes $500,000.00, so at a $750,000.00 sale the taxable gain is $0.00. At $600,000.00 the gain is $155,000.00 and the tax is $0.00 too. If you did not live in the home for 2 of the last 5 years, there is no exclusion: the taxable gain is the full $305,000.00 and the tax jumps to $52,780.00.

Step 3: Put the taxable gain through the bands

The 2026 capital gains rates are 0%, 15% and 20% (IRS Revenue Procedure 2025-32), and the taxable gain stacks on top of your other taxable income. Single: 0% through $49,450.00, 15% through $545,500.00; married filing jointly: $98,900.00 and $613,700.00; head of household: $66,200.00 and $579,600.00; married filing separately: $49,450.00 and $306,850.00. With $80,000.00 of other income the 0% band is already full, so the whole $55,000.00 falls in the 15% band: the tax is $8,250.00. With $30,000.00 of other income, $19,450.00 falls in the 0% band and $35,550.00 in the 15% band, so the tax is $5,332.50. With no other income, $49,450.00 falls in the 0% band and the tax is only $832.50. With $545,500.00 of other income the whole gain is pushed into the 20% band and the tax is $11,000.00.

Step 4: Add the 3.8% NIIT when it applies

The net investment income tax adds 3.8% on the taxable gain once your MAGI — other taxable income plus the taxable gain — passes $200,000.00 single ($250,000.00 married filing jointly, $125,000.00 married filing separately). The excluded gain is exempt: only the taxable gain counts. On the defaults, MAGI is $135,000.00, below the threshold, so the NIIT is $0.00. At $900,000.00 the NIIT is $3,230.00; at $1,500,000.00 it is $26,030.00. The NIIT starts when other income reaches $145,000.00 with a $55,000.00 taxable gain; at that income the NIIT is $0.00, at $1 more it is $0.04.

Step 5: Add state tax and work out what you keep

State tax is the taxable gain times your state rate: at 5% it adds $2,750.00, so the total tax is $11,000.00. The total federal tax is the capital gains tax plus the NIIT: on the defaults, $8,250.00 + $0.00 = $8,250.00. The effective rate is 15.00%. After-tax proceeds: $696,750.00.

The worked example

Single filer, $750,000.00 sale, $400,000.00 basis, $45,000.00 costs, qualified, $80,000.00 other income, 0% state rate. Step 1: the gain is $305,000.00. Step 2: the exclusion is $250,000.00, so the taxable gain is $55,000.00. Step 3: the 0% band is full, so the whole $55,000.00 falls in the 15% band and the tax is $8,250.00. Step 4: MAGI is $135,000.00, below the $200,000.00 threshold, so the NIIT is $0.00. Step 5: the total tax is $8,250.00 and the after-tax proceeds are $696,750.00. Rounding convention: totals are computed from unrounded values, so rounded parts may differ by a cent from their rounded sum.

Working backwards

The highest sale price with $0 federal tax, single, is $695,000.00; at $695,000.00 the tax is $0.00, at $695,001.00 it is $0.15. Married filing jointly, it is $945,000.00. The sale price for exactly $10,000.00 of tax is $761,666.67 (exact $761,666.6667); at that price the tax is $10,000.00 (unrounded $10,000.0005), at $1 less it is $9,999.85 (unrounded $9,999.8505). The largest taxable gain still taxed at 0%, with $30,000.00 of other income, is $19,450.00 (sale price $714,450.00). The basis needed for $0 tax at a $750,000.00 sale is $455,000.00.

What changes the answer most

Sale price moves the answer most: $600,000.00 gives $0.00 tax; $750,000.00 gives $8,250.00; $900,000.00 gives $33,980.00; $1,500,000.00 gives $163,755.00, with $339,500.00 taxed at 20%. Filing status is second: married filing jointly at $1,200,000.00 pays $38,645.00, a single filer $92,355.00. Other income is third: $30,000.00 gives $5,332.50, $80,000.00 gives $8,250.00, $545,500.00 gives $13,090.00. And qualifying for the exclusion matters more than any of them: without it, the tax at $750,000.00 is $52,780.00 instead of $8,250.00.

What not to do

Do not assume the exclusion is automatic — it needs 2 years of ownership and 2 years of living in the home, in the last 5 years. Do not forget the NIIT: at $1,500,000.00 it adds $26,030.00 on top of the $137,725.00 capital gains tax. Do not sell in a high-income year if you can wait: a year with $30,000.00 of other income instead of $80,000.00 cuts the tax from $8,250.00 to $5,332.50. And a 5% state rate adds $2,750.00 the federal calculation never shows.

How this connects

To run your own numbers, use the capital gains tax on home sale calculator. For the bracket detail, see the 2026 capital gains tax brackets, and to see what the same sale leaves after all taxes, see the take-home pay calculator.

Cite this guideBright Side Kit. “How to Calculate Capital Gains Tax on a Home Sale: A Guide” brightoolbox.com, 2026. Method: total gain = sale price − basis − selling costs; exclusion = $250,000 single / $500,000 MFJ when owned and lived in 2 of the last 5 years (IRC §121), else $0; taxable gain = gain − exclusion, floored at $0; the gain stacks on other income across the 0/15/20% bands (0% through $49,450 single, $98,900 MFJ, $66,200 HoH, $49,450 MFS; 15% through $545,500 single, $613,700 MFJ, $579,600 HoH, $306,850 MFS); NIIT = 3.8% × min(taxable gain, MAGI over $200,000 single / $250,000 MFJ / $125,000 MFS); state tax = taxable gain × state rate; after-tax proceeds = sale price − selling costs − total tax. Example: $750,000 sale, $400,000 basis, $45,000 costs, $80,000 other income → gain $305,000.00, taxable $55,000.00, tax $8,250.00, proceeds $696,750.00. Reverses: $695,000.00, $945,000.00, $761,666.67 (exact $761,666.6667), $19,450.00, $145,000.00, $455,000.00. Bright Side Kit. "How to Calculate Capital Gains Tax on a Home Sale: A Guide" https://brightoolbox.com/guides/how-to-calculate-capital-gains-tax-on-home-sale/ Accessed October 25, 2026.

Keep reading: Capital Gains Tax on Home Sale Calculator · 2026 Capital Gains Tax Brackets · Take-Home Pay Calculator

Frequently asked questions

How do I calculate capital gains tax on a home sale?

In five steps: the gain, the exclusion, the bands, the NIIT, and the total. On a $750,000.00 sale with a $400,000.00 basis and $45,000.00 of selling costs, the gain is $305,000.00, the exclusion leaves a $55,000.00 taxable gain, and the tax is $8,250.00.

How much of my home-sale gain is tax-free?

$250,000.00 if you are single, $500,000.00 if you are married filing jointly — if you owned and lived in the home for at least 2 of the last 5 years. At a $750,000.00 sale the exclusion leaves only a $55,000.00 taxable gain for a single filer, and nothing at all for a couple.

What are the capital gains tax rates on a home sale in 2026?

0%, 15% and 20%, depending on your income. For a single filer the 0% band runs through $49,450.00 and the 15% band through $545,500.00. The gain stacks on top of your other taxable income — with $545,500.00 of other income the whole gain is taxed at 20%.

What is the 3.8% NIIT on a home sale?

The net investment income tax adds 3.8% on the taxable gain once your MAGI passes $200,000.00 single ($250,000.00 married filing jointly). MAGI is your other taxable income plus the taxable gain — the excluded gain is exempt. At a $900,000.00 sale the NIIT is $3,230.00; at $1,500,000.00 it is $26,030.00.

What sale price gives exactly $10,000 of tax?

$761,666.67. At that price the taxable gain is $66,666.67 and the tax is $10,000.00. The exact price is $761,666.6667; at $761,666.67 the unrounded tax is $10,000.0005, at $761,666.66 it is $9,999.9990 — $761,666.67 is the nearest cent.

Can I pay $0 tax on a home sale?

Yes — if the gain fits inside the exclusion. A single filer can sell for up to $695,000.00 with $0 federal tax at these inputs ($400,000.00 basis + $45,000.00 costs + $250,000.00 exclusion); married filing jointly, up to $945,000.00. At $600,000.00 the gain is $155,000.00 and the tax is $0.00.