Skip to content

Capital Gains on Home Sale Calculator

Federal LTCG sketch on a home sale after Section 121-style exclusion. NIIT and state tax excluded.

Maintained by the Calcenzo team. Last reviewed October 26, 2026. Methodology

Capital Gains on Home Sale Calculator

Federal Section 121 exclusion only. NIIT (3.8%), depreciation recapture, and state capital gains taxes are not included. Partial exclusions for job moves / health events are not modeled. Not tax advice.

A capital gains home sale calculator estimates the federal tax on profit from selling your home after the Section 121 exclusion. The capital gains home sale calculator uses this formula: Gain = max(0, sale – basis – selling costs). Exclusion = 500000 joint or 250000 single if qualify yes, else 0. Taxable = max(0, gain – exclusion). Tax = taxable x LTCG rate / 100. Most owners who lived in the home for 2 of the last 5 years can exclude up to $250,000 of gain, or $500,000 for married couples filing jointly. A single seller with a $450,000 gain would owe tax on $200,000.

capital gains home sale calculator
Capital gains home sale calculator chart: taxable gain after the Section 121 exclusion.

How to use the capital gains home sale calculator

  1. Enter the sale price, your adjusted basis and your selling costs.
  2. Choose your filing status.
  3. Say whether you meet the 2-out-of-5-year ownership and use tests.
  4. Enter your long-term capital gains rate: 0%, 15% or 20%.
  5. Read the realized gain, exclusion, taxable gain and estimated federal tax.

What formula does the capital gains home sale calculator use?

  • Gain = sale price − adjusted basis − selling costs
  • Section 121 exclusion = $250,000 (single) or $500,000 (married filing jointly) if you qualify
  • Taxable gain = gain − exclusion (not below 0)
  • Estimated federal tax = taxable gain × your long-term capital gains rate

Adjusted basis is what you paid plus certain purchase costs and the cost of improvements, minus items such as depreciation you claimed or casualty losses.

Capital gains home sale calculator worked example

A home bought for $400,000 (including improvements) sells for $900,000 with $50,000 of selling costs, so the gain is $450,000:

Filing status Exclusion Taxable gain Tax at 15%
Married filing jointly $500,000 $0 $0
Single $250,000 $200,000 $30,000

A married couple who both meet the use test and file jointly owe no federal tax on this gain. A single owner pays 15% on $200,000, or $30,000, if that is their bracket.

Who qualifies for the exclusion

IRS Publication 523 sets the main tests. You generally qualify if, during the 5 years before the sale, you owned the home for at least 2 years and lived in it as your main home for at least 2 years, and you did not exclude a gain from another home sale in the 2 years before. Married couples can exclude up to $500,000 if either spouse meets the ownership test, both meet the use test, and neither used the exclusion in the prior 2 years. A partial exclusion can apply if you sell early because of a job change, health or certain unforeseen events; the capital gains home sale calculator does not compute partial exclusions.

2026 long-term capital gains rates

Rate Single Married filing jointly
0% Up to $49,450 Up to $98,900
15% $49,451 to $545,500 $98,901 to $613,700
20% Over $545,500 Over $613,700

The thresholds are for taxable income including the gain (Rev. Proc. 2025-32). Gains on a home owned one year or less are short-term and taxed at ordinary rates. The 3.8% net investment income tax can also apply to the taxable part of the gain when modified AGI is above $200,000 (single) or $250,000 (married filing jointly).

What the calculator leaves out

  • State income tax on the gain.
  • Depreciation recapture if you rented the home or used part of it for business; that portion cannot be excluded.
  • Periods of nonqualified use, such as renting before you moved in, which can reduce the exclusion.
  • Gains spread across more than one bracket; enter the rate that applies to most of the gain.

Estimates for education only, not tax, legal or financial advice. Check current rules with the tax authority or a qualified adviser.

Building your adjusted basis

The gain on a home sale is the amount realized minus the adjusted basis, and most people understate their basis. Basis starts with the purchase price, then adds certain purchase closing costs and the cost of improvements that add value or extend the home’s life, such as a new roof, a kitchen remodel or an addition. Routine repairs and painting do not count, and entering them in a capital gains home sale calculator overstates basis.

Here is how the capital gains home sale calculator handles a typical case. Take a home bought for $250,000 with $4,000 of qualifying purchase costs and $60,000 of improvements. The adjusted basis is $314,000. It sells for $720,000 with $40,000 of selling costs, so the amount realized is $680,000 and the gain is $366,000. A single filer who meets the ownership and use tests excludes $250,000 and owes tax on $116,000. A married couple filing jointly can exclude $500,000 and owes nothing.

Keep receipts for improvements for as long as you own the home and for a few years after. Without records, the capital gains home sale calculator result will be higher than it needs to be.

Related calculators:

Sources

IRS Publication 523: Selling Your Home; IRS Topic 701: Sale of your home; IRS Rev. Proc. 2025-32 (2026 inflation adjustments); IRS Topic 559: Net investment income tax.

Questions about this calculator

How much capital gains tax do I pay on a home sale?

Subtract basis and selling costs from the price, then the $250,000 or $500,000 exclusion if you qualify; tax the rest at your long-term rate.

What is the 2-out-of-5-year rule?

You must have owned and lived in the home as your main home for at least 2 of the 5 years before the sale.

What are the 2026 capital gains rates?

0%, 15% and 20%. The 15% rate starts above $49,450 of taxable income for single filers and $98,900 for joint filers.

Do I pay tax if my gain is under $250,000?

Not federal tax, if you qualify for the full exclusion and are single.

Does the 3.8% NIIT apply to home sales?

Only to the taxable part of the gain, and only above the MAGI thresholds.

Check the assumptions and units before relying on a result. Financial, tax and health estimates do not replace advice for your individual circumstances.

Report a calculation issue

Related articles

Guides that explain the ideas behind this calculator in more detail.