Smekys
Ad Space

Home Sale Capital Gains Tax Calculator

Calculate capital gains tax on your home sale: cost basis, selling costs, the $250K/$500K Section 121 exclusion, and what you actually owe the IRS.

Enter Values

$

What you originally paid for the home, per the closing statement.

$

The gross price the buyer is paying you.

%

Realtor commissions plus closing costs; ~6% is typical.

$

Add-ons that extend the home's life (roof, addition, kitchen remodel), not repairs.

Single excludes up to $250K of gain; MFJ up to $500K (Section 121).

%

Usually 0%, 15%, or 20% for assets held over a year.

Result

Adjusted Cost Basis
$450,000.00
Selling Costs
$39,000.00
Amount Realized
$611,000.00
Total Capital Gain
$161,000.00
Section 121 Exclusion Applied
$250,000.00
Taxable Gain After Exclusion
$0.00
Estimated Federal Capital Gains Tax
$0.00
Tax-Free Gain
$161,000.00

Selling a home usually feels like winning, but the IRS wants its cut when the check clears. Most homeowners are surprised to learn that the profit on a primary residence is technically a capital gain — and, without the right paperwork, a seven-figure sale can trigger a five- or six-figure tax bill overnight. This calculator walks the IRS Pub 523 formula step by step: it nets your selling costs against the sale price, adds any capital improvements back into your cost basis, subtracts the Section 121 home-sale exclusion, and applies the long-term capital gains rate you owe.

Plug in your numbers below and the result card tells you exactly how much of your profit is tax-free, how much is taxable, and roughly what you will write on Schedule D next April.

How to Use

  1. Enter the Original Purchase Price — what you actually paid at closing, not the assessed value or the Zestimate. Pull the number from your settlement statement (HUD-1 or Closing Disclosure).
  2. Enter the Sale Price the buyer has agreed to pay you. If you have not closed yet, use the agreed contract price.
  3. Set Selling Costs as a percentage of the sale price. Realtor commissions typically run 5–6%, and seller concessions, transfer taxes, title insurance, and attorney fees add another 1–2%. Leave the slider at 6% if you are unsure.
  4. Add Capital Improvements — money you spent that increases the home's value: a new roof, an addition, a kitchen gut-renovation, finished basement, new HVAC. Routine repairs, painting, and cleaning do not count.
  5. Pick your Filing Status. Single filers exclude up to $250,000 of gain; Married Filing Jointly couples exclude up to $500,000.
  6. Set your Long-Term Capital Gains Rate. If you owned and lived in the home for at least two of the last five years, the IRS taxes the remaining gain at 0%, 15%, or 20% depending on your total taxable income. The default 15% fits most middle- and upper-middle-income households.

The result card breaks out adjusted basis, selling costs, amount realized, the Section 121 exclusion applied, the taxable gain, and the estimated federal tax.

The IRS Formula, Plain English

The IRS does not tax the sale price itself — it taxes the gain, and the gain is the sale price minus everything you legitimately subtract:

  • Amount Realized = Sale Price − Selling Expenses
  • Adjusted Basis = Purchase Price + Capital Improvements
  • Gain = Amount Realized − Adjusted Basis
  • Exclusion = $250,000 (Single) or $500,000 (MFJ), if you pass the ownership-and-use test
  • Taxable Gain = max(0, Gain − Exclusion)
  • Estimated Tax = Taxable Gain × your long-term capital gains rate

Walk through the classic example on this page's defaults: bought for $400,000, sold for $650,000, 6% selling costs = $39,000, and $50,000 of improvements. Amount realized is $611,000; adjusted basis is $450,000; total gain is $161,000. A Single filer subtracts the $250,000 exclusion and owes $0 — the entire gain is tax-free.

Ownership-and-Use Test: The Fine Print

The $250K / $500K exclusion is not automatic. To claim it you must pass two tests during the five-year window ending on the sale date:

  • Ownership test: you owned the home for at least 2 years.
  • Use test: you lived in the home as your main residence for at least 2 years.

The two periods do not have to be continuous, but they must add up to 24 months each. Short temporary absences (vacations, medical sabbaticals) still count as use. If you rented the home out for several years before moving back, you may have to recapture depreciation — that portion of the gain does not qualify for the exclusion and is taxed at 25%.

If you did not meet the two-out-of-five test but had to move for a job, health, or unforeseeable reasons, the IRS lets you claim a reduced, prorated exclusion based on how many months you actually lived there.

Examples

Example 1 — The default, fully tax-free sale. A couple bought a home for $400,000, spent $50,000 on a kitchen and roof, and sold for $650,000. Selling costs at 6% are $39,000. Gain is $161,000. Even as a Single filer, the $250,000 exclusion wipes out the entire gain — estimated federal tax: $0.

Example 2 — A gain that exceeds the exclusion. A buyer paid $600,000, added no improvements, and sold for $1,200,000 with 6% selling costs. Amount realized is $1,128,000; adjusted basis is $600,000; gain is $528,000. A Single filer excludes $250,000 and is taxed on $278,000 at 15% — about $41,700 owed to the IRS. Filing jointly cuts that to roughly $4,200 because the exclusion doubles to $500,000.

Example 3 — A small flip-ish sale. A seller bought for $300,000, put in $20,000 of improvements, and sold at $350,000 with no realtor (FSBO, 0% commission). Gain is $30,000 — well under the $250,000 exclusion — so tax owed is $0 even though there is a clear profit on paper.

FAQ

How much is the home sale capital gains exclusion?

If you owned and lived in the home for two of the last five years, you can exclude up to $250,000 of gain as a Single filer or up to $500,000 if you are Married Filing Jointly. This is the Section 121 exclusion, and it is one of the largest tax breaks the IRS gives ordinary households.

Do I have to pay capital gains if I sell my house for a profit?

Usually no — if the gain is below your exclusion ($250K / $500K), federal tax is $0 and you do not even need to report the sale on your tax return. You only owe tax when the gain exceeds the exclusion, or when you cannot meet the two-out-of-five ownership-and-use test.

What counts as a capital improvement to my cost basis?

Additions, a new roof, a new HVAC system, a finished basement, a kitchen or bathroom remodel, new windows, and a new deck all increase your basis. Routine repairs, painting, cleaning, and staging do not. Keep every invoice — they are your deduction if the IRS ever audits.

Can I use the exclusion more than once?

Yes, but no more than once every two years. You can sell two primary residences six years apart and exclude the gain on each one, as long as you pass the ownership-and-use test on both. You cannot flip an investment property and claim the exclusion.

I rented out my old house for a few years. Do I still get the exclusion?

Partial credit. The two-out-of-five test still applies to the period you lived there, but any depreciation you took while renting is un-recaptured Section 1250 gain taxed at 25% and cannot be excluded. The rest of the gain still qualifies for the $250K / $500K exclusion if you meet the tests.

What if I sell before two years because of a job relocation?

The IRS lets you claim a reduced exclusion proportional to how many months you actually lived in the home. If you owned and used it for 12 months out of the required 24, you can exclude 12/24 (half) of the full $250K / $500K amount.

Are state capital gains taxes included?

This calculator estimates federal tax only. Most states tax home-sale gains as ordinary income (California, for example, taxes the full gain with no exclusion), so budget an extra 3–10% on top of the federal number unless you live in Florida, Texas, Washington, or another no-income-tax state.

Disclaimer

This home sale capital gains calculator is provided for informational purposes only and does not constitute tax, legal, or financial advice. Estimates are based on the inputs you enter, the IRS Pub 523 formula, and the 2024 Section 121 exclusion amounts ($250,000 Single / $500,000 MFJ); actual results depend on your exact ownership-and-use history, depreciation taken, state of residence, and total household income. Always confirm your final liability with a qualified CPA or enrolled agent before closing a sale.

Related Calculators

Disclaimer

Results are estimates for illustration only. Verify important figures independently.