Skip to main content

Home Sale Capital Gains Calculator

The sale & what you paid

$
$
$
%
$
$

Your result will appear here

Fill in the fields and this updates as you type.

Calculation transparency

Know what this estimate is based on

Jurisdiction
United States — state and local practice, with federal tax rules on a sale, a rental or depreciation
Rules and time period
Prices, rents and rates are the figures you enter. Property tax rates, transfer taxes and landlord-tenant rules change by jurisdiction and are re-set locally.
Scope and limitations
Educational estimate only. U.S. real estate costs are local: property tax rates, transfer and recording taxes, title practice, who customarily pays which closing cost, and landlord-tenant rules all change by state and often by county or city. Agent commission is negotiable and, since the 2024 NAR settlement, buyer-agent compensation is negotiated separately rather than assumed. Only a lender's Loan Estimate, a title company's fee sheet or a signed contract binds a number.
Source links checked
Sep 19, 2026

Built and regression-tested by Smart Tools Lab. It has not been individually reviewed by a licensed financial, tax, or legal professional.

How to use

  1. 01

    Enter the sale price and what you originally paid.

  2. 02

    Enter every capital improvement you can document. Each dollar raises your basis and cuts the gain.

  3. 03

    Enter selling costs as a percentage — commission, transfer tax, title and attorney fees together.

  4. 04

    Set the exclusion: $250,000 filing single, $500,000 filing jointly. The field steps in $250,000 increments so it is one click.

  5. 05

    Read whether the exclusion covers you. If it does not, the waterfall below shows exactly where the taxable gain comes from.

Formula

The adjusted basis is what you paid, plus the closing costs when you bought, plus every capital improvement since. Selling costs are a percentage of the sale price, and the amount realized is the sale price minus them. The gain is the amount realized minus the adjusted basis, floored at zero — a loss on a personal residence is not deductible, so a negative result is reported as a loss with no tax rather than as a deduction. The section 121 exclusion shelters the lesser of the gain and the exclusion limit, and only the remainder is taxable. Federal capital gains tax and state tax apply to that taxable remainder rather than to the whole gain, which is why the exclusion protects you from both. The net investment income tax is a further test rather than a third rate: it is charged only once your other income plus the taxable gain passes the threshold — $250,000 where you have taken the joint exclusion, $200,000 otherwise — and then only on the smaller of the taxable gain and the amount above that line. A sale the exclusion covers in full never reaches it at all. Proceeds after tax are the amount realized less the total tax, before any mortgage is repaid.

Example

Selling for $620,000 a home bought for $180,000, with $4,000 of closing costs at purchase, $45,000 of documented improvements, 7% selling costs, and the $250,000 single-filer exclusion. Step 1 — Adjusted basis: $180,000 + $4,000 + $45,000 = $229,000. Step 2 — Selling costs: $620,000 x 7% = $43,400. Amount realized: $576,600. Step 3 — Total gain: $576,600 − $229,000 = $347,600. Step 4 — The exclusion covers $250,000, leaving $97,600 taxable. Step 5 — Tax: the federal rate is not one number. The taxable gain stacks on top of your other income, and with none entered the first $49,450 of it sits in the 0% band; the $48,150 above that is taxed at 15%, which is $7,223. There is no net investment income tax here either — the $97,600 sits below the $200,000 threshold the surtax starts at. Add 5% state ($4,880) and the bill is $12,103. Proceeds after tax: $564,498. Three things are worth pulling out. First, enter your other income and this figure moves: the same sale on top of a $200,000 salary uses none of the 0% band and picks up the surtax. Second, the $45,000 of improvements saved $9,000 of tax on their own — the receipts were worth a fifth of what the work cost. Third, filing jointly would raise the exclusion to $500,000 and eliminate the tax entirely. Between a single and a joint filer with identical facts, this sale is a $12,103 difference.

Definitions

Section 121 exclusion
The rule sheltering up to $250,000 of home-sale gain for single filers and $500,000 for joint filers.
Adjusted basis
Purchase price plus buying closing costs plus capital improvements. What the gain is measured against.
Amount realized
Sale price minus selling costs. The top of the gain calculation.
Capital improvement
Work that adds value or prolongs life. Raises basis; unlike a repair, which does not.
Two-of-five rule
The ownership and residence test: two of the five years before the sale, not necessarily continuous.
Partial exclusion
A prorated exclusion available when a qualifying change in work, health or circumstances forces an early sale.
Long-term capital gain
Gain on an asset held over a year, taxed federally at 0%, 15% or 20%.
Net investment income tax
A 3.8% surtax on investment income above $200,000 single or $250,000 joint.
Form 1099-S
The information return reporting a real estate sale to the IRS. Report the sale if you receive one, even with no tax due.
Non-qualified use
Periods the home was not your main residence, which can reduce the exclusion proportionally.
Selling costs
Commission, transfer taxes, title and attorney fees. They reduce the amount realized and therefore the gain.
Stepped-up basis
The reset to market value at death, which eliminates the gain for heirs entirely.

Good to know

The exclusion that makes most home sales tax-free

Section 121 lets a single filer exclude $250,000 of gain on a primary residence and a married couple filing jointly exclude $500,000. It is the reason the large majority of US home sales produce no federal tax at all, and it is available repeatedly — once every two years, for as many houses as you own over a lifetime. The test has two parts and both are measured over the five years before the sale: you must have owned the home for at least two of them, and lived in it as your main home for at least two of them. The two-year periods do not have to be continuous and they do not have to be the same two years. Here a $347,600 gain less the $250,000 exclusion leaves $97,600 taxable — a large sale, and still a tax bill of $12,103 rather than one computed on the whole gain.

Basis is where the money is, and receipts are the proof

The gain is the amount realized less the adjusted basis, so every dollar added to basis is a dollar of gain removed. Basis starts at the purchase price and adds the closing costs you paid when buying — title, recording, survey, legal, transfer tax — and every capital improvement since. A new roof, an HVAC system, a kitchen renovation, an addition, new windows, a fence, landscaping that is permanent rather than maintenance: all of it counts, and $45,000 of improvements here removes $45,000 of gain. Repairs and maintenance do not count, and neither does anything you were reimbursed for. The practical difficulty is documentary rather than legal — this arithmetic runs over decades, and the receipts have to survive it. A folder, physical or scanned, kept from the day you buy is worth your capital gains rate on every dollar in it.

Partial exclusions for a sale you did not plan

Failing the two-year test does not automatically forfeit the exclusion. If the sale is driven by a change in place of employment, a health condition, or an unforeseeable circumstance the regulations recognize, a partial exclusion applies in proportion to the time you did qualify. Eighteen months of a required twenty-four gives 75% of the limit — $187,500 for a single filer. The safe harbours are specific: an employment move of at least fifty miles further from the home than the old job was, a physician-recommended move for the diagnosis or care of a disease, and a listed set of unforeseeable events including death, divorce, multiple births from a single pregnancy, and job loss qualifying for unemployment. Outside the safe harbours the facts and circumstances still count, but they need to be documented at the time rather than reconstructed afterwards.

The three taxes stacked on the taxable part

The $97,600 that survives the exclusion is not taxed at one rate. Federal long-term capital gains runs at 0%, 15% or 20% depending on total taxable income, and the 0% bracket is wider than people expect — a married couple with modest other income can genuinely pay nothing on a substantial gain. Above the threshold sits the 3.8% net investment income tax, which applies to the lesser of net investment income and the amount by which modified adjusted gross income exceeds $200,000 single or $250,000 joint. Then state tax: most states tax capital gains as ordinary income with no preferential rate, a handful have no income tax at all, and a few offer partial exclusions. This page works that stacking out rather than assuming a rate: enter what else you earned and the gain is laid on top of it, band by band. In the worked example there is no other income, so the first $49,450 is taxed at nothing and only the $48,150 above it at 15% — $7,223 federal, no surtax, and $4,880 of state tax, for $12,103 in all, an effective 12.4% of the taxable gain. Put the same sale on top of a $200,000 salary and it becomes $23,229: the 0% band is gone and the surtax has started. The state layer is the one most sellers forget to budget for, and their own income is the input most of them leave blank.

What the exclusion does not cover

Three gaps catch sellers. Depreciation taken after May 1997 — from a home office, or from a period when the property was rented — is never excluded, and comes back as unrecaptured section 1250 gain at up to 25%. Periods of non-qualified use since 2009, meaning time the property was not your main home, are allocated out of the exclusion proportionally, which particularly affects a rental converted to a residence rather than the other way round. And a loss on a personal residence is not deductible at all, which is why the gain here floors at zero rather than going negative. The exclusion is also not indexed for inflation: $250,000 and $500,000 have been the limits since 1997, and in high-appreciation markets that means a growing share of ordinary long-term homeowners now exceed them.

Frequently asked questions

Do I owe tax when I sell my house?

Usually not. The section 121 exclusion shelters up to $250,000 of gain for a single filer and $500,000 for a couple filing jointly, and most US home sales fall inside it. You owe tax only on the gain above that.

What do I have to do to qualify?

Own the home and live in it as your main residence for at least two of the five years before the sale, and not have used the exclusion on another sale in the previous two years. The two years of residence do not have to be continuous.

Is the gain the same as my profit?

No, and this is where people go wrong. The gain is the sale price minus selling costs minus your adjusted basis — what you paid, plus closing costs when you bought, plus every capital improvement since. It is not the difference between the two prices, and it is not the cash you walk away with after the mortgage.

What counts as a capital improvement?

Work that adds value, prolongs life or adapts the home to new uses: an addition, a new roof, a kitchen remodel, central air, a fence, landscaping. Not repairs — repainting, fixing a leak, replacing a broken pane. The distinction is worth real money, and it is why the receipts matter for decades.

Can I deduct a loss on my home?

No. A loss on a personal residence is not deductible, which is why this calculator floors the gain at zero. That asymmetry is deliberate in the tax code: gains above the exclusion are taxed, losses are simply yours.

Do the limits ever change?

They have not since 1997, and they are not indexed to inflation. A $250,000 exclusion in 1997 dollars would be well over $500,000 today, which is why sales that would once have been comfortably covered increasingly are not — particularly for long-tenured owners in appreciated markets.