Plain-English guides to owning a home in the US

Theme

Tools · Property tax

Home Sale Capital Gains Calculator (Section 121)

Selling your main home? Estimate your gain on the sale, how much of it the IRS home sale exclusion can remove, and how much may still be taxable.

Example values are filled in. Replace them with your own numbers.

Commissions, advertising, legal fees and other costs of selling.

Use your cost basis; some purchase settlement costs can be added (see IRS Pub 523).

Additions, new roof, new systems. Not routine repairs like painting.

Owned and lived in the home as your main home for 24 months of the last 5 years.

Your result

Estimated taxable gain

$0

Your gain on the sale is about $280,000. Up to $280,000 may be excluded, leaving an estimated taxable gain of $0.

Total gain on the sale
$280,000
Gain excluded under Section 121
$280,000
Adjusted basis
$330,000
Amount realized
$610,000

Runs in your browser. Nothing you type is sent or stored.

Updated

Quick steps

  1. Enter the sale price and your selling costs.
  2. Enter what you paid for the home and the cost of capital improvements.
  3. Choose your filing status.
  4. Say whether you meet the ownership and use tests (24 months of the last 5 years).
  5. Read your gain, the excluded amount and the estimated taxable gain.

Most homeowners who sell their main home owe no federal tax on the profit, thanks to the home sale exclusion in Section 121 of the tax code. This home sale capital gains calculator shows your gain, how much of it the exclusion may cover, and what may be left over as taxable gain.

How to use this calculator

  1. Sale price. Enter the contract price. Your closing statement or Form 1099-S shows it.
  2. Selling costs. Add commissions, advertising, legal fees and similar costs from the seller’s side of your closing statement.
  3. Purchase price. Enter what you paid. IRS Publication 523 explains which purchase settlement costs can be added to your basis.
  4. Capital improvements. Add up receipts for additions, a new roof, new systems and other improvements. Keep these records; you may need them if the IRS asks.
  5. Filing status. Choose single or married filing jointly.
  6. Tests. Choose “Yes” only if you meet both the ownership and use tests (24 months each in the 5 years before the sale) and did not use the exclusion on another sale in the past 2 years.

How this calculator works

Amount realized = Sale price − Selling costs
Adjusted basis = Purchase price + Capital improvements
Gain = Amount realized − Adjusted basis
Exclusion limit = $500,000 (joint) or $250,000 (single), or $0 if you do not qualify
Excluded = the smaller of Gain and Exclusion limit (never below $0)
Taxable gain = Gain − Excluded (never below $0)

If the gain is negative, you have a loss. A loss on a personal home is not deductible, and the tool shows a taxable gain of $0.

Worked examples

These are hypothetical examples using simple numbers.

Example 1 (default inputs). A married couple filing jointly sells for $650,000, pays $40,000 in selling costs, bought for $300,000 and spent $30,000 on improvements. They meet both tests.

  • Amount realized: $650,000 − $40,000 = $610,000
  • Adjusted basis: $300,000 + $30,000 = $330,000
  • Gain: $610,000 − $330,000 = $280,000
  • Excluded: smaller of $280,000 and $500,000 = $280,000
  • Taxable gain: $0

Example 2 (single filer). Same numbers, but the seller files as single.

  • Gain: $280,000
  • Excluded: smaller of $280,000 and $250,000 = $250,000
  • Taxable gain: $30,000

If that same seller did not meet the tests at all, the exclusion would be $0 and the whole $280,000 would show as taxable gain.

What your result means

A taxable gain of $0 usually means no federal tax on the sale, although you may still need to report it. A taxable gain above $0 is added to your income for the year as a capital gain. The tax depends on your income, so this tool does not estimate the dollar tax.

SituationExclusion limit in this toolTaxable gain on a $280,000 gain
Married filing jointly, meets tests$500,000$0
Single, meets tests$250,000$30,000
Does not meet tests$0$280,000

Rules that change the answer

  • Ownership and use tests. You need 24 months of ownership and 24 months of use as your main home within the 5 years before the sale. They do not need to be the same 24 months (IRS Topic 701).
  • Once every 2 years. You generally cannot use the exclusion if you used it on another home within the past 2 years.
  • Partial exclusion. A work-related move, health reason or unforeseeable event such as divorce or job loss may allow a reduced exclusion (IRS Pub 523).
  • Military and similar service. Members of the Uniformed Services, Foreign Service or intelligence community on qualified extended duty can suspend the 5-year period for up to 10 years.
  • Tax rates. Long-term gains are generally taxed at 0%, 15% or 20%; gains on property held one year or less are taxed as ordinary income (IRS Topic 409).
  • State tax. Many states tax capital gains as income; check your state revenue department.

Common mistakes

  • Counting repairs, like painting or fixing a leak, as improvements.
  • Forgetting to subtract selling costs.
  • Assuming a spouse who did not live in the home still qualifies both of you for $500,000.
  • Throwing away improvement receipts.
  • Skipping reporting when a Form 1099-S was issued.

Limits and when to get help

This tool covers the basic Section 121 calculation only. It does not handle partial exclusions, depreciation from a home office or rental use, periods of nonqualified use, inherited or gifted homes, or state taxes. Your property tax situation also changes when you sell; see how property taxes work. For a real return, use IRS Publication 523 and talk to a CPA or enrolled agent.

Frequently asked questions

How much home sale profit is tax free?

If you qualify, you can exclude up to $250,000 of gain, or up to $500,000 if you are married filing jointly, according to the IRS. Gain above that can be taxable.

What are the 2-out-of-5-year rules?

You must have owned the home and lived in it as your main home for at least 24 months each during the 5 years before the sale. The months do not have to be in a row. For the $500,000 joint exclusion, either spouse can meet the ownership test but both must meet the use test.

What counts as a capital improvement?

Improvements that add value, extend the home's life or adapt it to new uses, such as an addition, a new roof or new systems. IRS Publication 523 says routine repairs like painting or fixing leaks generally do not count unless part of a larger remodel.

Do selling costs reduce my gain?

Yes. Selling expenses such as commissions, advertising and legal fees reduce the amount realized, which reduces the gain.

What if I do not meet the 2-year tests?

You may still qualify for a partial exclusion if the main reason for the sale was a work move, a health reason or an unforeseeable event. This tool does not calculate partial exclusions; use the worksheet in IRS Publication 523 or ask a tax professional.

Do I have to report the sale if all the gain is excluded?

You must report it if you receive Form 1099-S, even if the whole gain is excludable, and whenever any part of the gain is taxable, according to IRS Topic 701.

What tax rate applies to the taxable part?

For a home held more than one year, long-term capital gain rates of 0%, 15% or 20% generally apply, depending on your taxable income. Some people also owe the net investment income tax, and state income tax may apply.

How often can I use the home sale exclusion?

Generally once every two years. You cannot claim it if you excluded gain on another home sold within the 2 years before this sale, with some exceptions.

Sources

  1. Publication 523 (2025), Selling Your Home · Internal Revenue Service · accessed
  2. Topic no. 701, Sale of your home · Internal Revenue Service · accessed
  3. Topic no. 409, Capital gains and losses · Internal Revenue Service · accessed

Guides that explain this

Related tools

Search the site

Popular topics

↑ ↓ to moveEnter to openEsc Close