Home › Calculators › Home Sale Capital Gains Tax Calculator

Home Sale Capital Gains Tax Calculator

Selling your home? Enter the sale price, what you paid, improvements and selling costs, and how long you owned and lived in it. The calculator applies the Section 121 exclusion of up to $250,000 ($500,000 for married couples filing jointly), including partial exclusions, and estimates the tax on any gain that is left.

Last updated:

Sale
$
$

Agent commissions, title, transfer taxes and other closing costs you paid.

Purchase & improvements
$
$

Title, recording, transfer taxes (not loan fees or prepaid interest).

$

Additions, new roof, remodels; not repairs or maintenance.

$
Ownership & use
years
years

Allows a partial exclusion if you don't meet the 2-year tests.

Tax rates

2026: 0% up to $49,450 taxable income (single) / $98,900 (joint); 20% above $545,500 / $613,700.

%

Used when you owned the home 1 year or less.

%

Federal maximum 25%.

%

Applies to taxable gain if MAGI is above $200,000 (single) / $250,000 (joint).

Enter your values to see the result.
Advertisement
Advertisement

How to use the Home Sale Capital Gains Tax Calculator

  1. Enter the sale price and selling costs.
  2. Enter the purchase price, buying closing costs and capital improvements to build your cost basis.
  3. Choose your filing status and enter the years you owned the home and lived in it during the last 5 years.
  4. Tick the boxes if you used the exclusion recently or are moving early for a qualifying reason.
  5. Pick your tax rates and read the taxable gain and estimated tax.

How home sale capital gains are calculated

  1. Amount realized = sale price − selling costs
  2. Adjusted basis = purchase price + buying costs + capital improvements − depreciation claimed
  3. Gain = amount realized − adjusted basis
  4. Exclusion = $250,000 (single) or $500,000 (married filing jointly) if you meet the 2-out-of-5-year tests, or a prorated share for a qualifying early move
  5. Taxable gain = gain − exclusion (depreciation after May 6, 1997 is always taxable, at up to 25%)

Example with the default numbers: a couple sells for $850,000 and pays $48,000 in selling costs. They paid $320,000 plus $6,000 of closing costs and spent $75,000 on improvements, so the basis is $401,000 and the gain is $401,000. The $500,000 exclusion covers all of it, so there is no tax. If they were single, $151,000 would be taxable: at 15% + 3.8% NIIT + 5% state, about $35,900.

Exclusion rules at a glance

SituationMaximum exclusion
Single, head of household, married filing separately (each)$250,000
Married filing jointly, both lived there 2 of last 5 years$500,000
Surviving spouse, sold within 2 years of spouse's death$500,000
Moved early for work, health or unforeseen event$250,000 / $500,000 × months ÷ 24
Excluded gain on another home within 2 yearsNone (partial only for a qualifying reason)
Depreciation claimed after May 6, 1997Not excludable; taxed at up to 25%

The $250,000 and $500,000 limits are set in the tax code and are not adjusted for inflation. The 2-year periods do not have to be continuous: 24 months in total within the 5 years before the sale is enough.

Tips

  • Your closing statement from the purchase and receipts for improvements are what prove your basis.
  • If you sold an investment property instead, a 1031 exchange may defer the tax.
  • See how much cash you will walk away with using the seller net proceeds calculator.

Frequently asked questions

How much profit on a home sale is tax-free?

Under Section 121 you can exclude up to $250,000 of gain if you are single, and up to $500,000 if you are married filing jointly, as long as you owned and lived in the home as your main home for at least 2 of the 5 years before the sale and haven't used the exclusion in the past 2 years.

How is the gain on a home sale calculated?

Gain = sale price − selling costs − adjusted basis. The adjusted basis is what you paid, plus certain buying closing costs and the cost of capital improvements, minus any depreciation you claimed for a home office or rental use.

What if I haven't lived in the house for 2 years?

You may still get a partial exclusion if you sold mainly because of a job change, health reasons or certain unforeseen circumstances. The exclusion is prorated: for example, 12 months of qualifying ownership and use gives 12/24 = 50% of the $250,000 or $500,000 limit.

Which home improvements increase my basis?

Improvements that add value, extend the home's life or adapt it to new uses count: additions, a new roof, a remodeled kitchen, new HVAC, landscaping, fencing. Ordinary repairs and maintenance, like repainting a room or fixing a leak, do not. Keep receipts for the life of the home.

What capital gains rate applies to a home sale?

If you owned the home for more than a year, any taxable gain is long-term and taxed at 0%, 15% or 20% depending on your taxable income, plus possibly the 3.8% net investment income tax and state tax. Gain from depreciation claimed after May 6, 1997 is taxed at up to 25% and cannot be excluded.

Do married couples always get the $500,000 exclusion?

To get $500,000 on a joint return, either spouse must meet the ownership test, both must meet the 2-year use test, and neither can have used the exclusion in the previous 2 years. If only one spouse qualifies, that spouse can usually exclude up to $250,000. A surviving spouse can use $500,000 if the home is sold within 2 years of the spouse's death.

Does this cover rental periods before I moved in?

Not fully. Gain allocated to periods of nonqualified use (such as renting the home out before you made it your main home, after 2008) is not excludable. This calculator handles depreciation recapture but not the nonqualified use allocation, so ask a tax professional if that applies.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

1031 Exchange CalculatorDeferred and taxable gain on a like-kind exchange, with boot, recapture and new basis.Capital Gains CalculatorGain or loss on a sale, short- or long-term tax at your rates, net proceeds and return.Home Sale Proceeds CalculatorEstimate the cash you keep after selling a home: commission, closing costs, taxes and payoff.Home Appreciation CalculatorProject home value by year from a growth rate or find the rate from today's value, with equity.Depreciation Recapture CalculatorTax on selling depreciated property: §1250 gain at up to 25%, §1245 recapture and capital gain.Income Tax CalculatorEstimate US federal income tax after deductions and credits, with effective and marginal rate.Social Security Benefits CalculatorEstimate your monthly Social Security benefit and compare claiming at 62, full age or 70.GST CalculatorAdd or remove GST at any rate, with India CGST/SGST split and AU, NZ and Canada presets.Reverse Sales Tax CalculatorBack out sales tax from a total: pre-tax price and tax amount, one total or a whole list.Salary to Hourly CalculatorConvert hourly, weekly, monthly and yearly pay, with overtime.VAT CalculatorAdd or remove VAT and sales tax with country rate presets.Sales Tax CalculatorAdd sales tax to a price or find the pre-tax price from a total, with US state rates.Commission CalculatorCalculate flat or tiered sales commission and total pay with a base salary.Overtime CalculatorOvertime pay at time and a half or double time, with weekly, monthly and annual totals.Pay Raise CalculatorNew salary after a raise by percent or amount, with hourly, monthly and real (after inflation) figures.Paycheck CalculatorEstimate take-home pay per paycheck from hourly or salary pay, taxes and deductions.Freelance Hourly Rate CalculatorWork out the hourly and day rate you need from income goals, expenses, taxes and time off.Property Tax CalculatorAnnual and monthly property tax from value, assessment ratio, exemptions and % or mill rate.Hourly to Salary CalculatorConvert an hourly wage to annual, monthly, biweekly, weekly and daily pay, with overtime.Bonus Tax CalculatorEstimate take-home pay on a bonus: 22% federal supplemental rate, FICA and state tax.Self-Employment Tax CalculatorCalculate Social Security and Medicare self-employment tax (15.3%) and the deductible half.Real Estate Commission CalculatorCalculate realtor commission, the agent and broker split, and the seller's net proceeds.Holiday Pay CalculatorWork out pay for holiday hours at 1.5x, 2x or any multiplier, plus total gross pay.Job Offer Comparison CalculatorCompare up to 3 job offers by total compensation, commute, PTO and effective hourly rate.Per Diem CalculatorCalculate a travel per diem from trip dates, lodging and M&IE rates and provided meals.Prorated Salary CalculatorProrated pay for a partial month or year by calendar days or working days, with the daily rate.Quarterly Estimated Tax CalculatorQuarterly estimated tax payments and a due-date schedule for freelancers and the self-employed.Gross Up CalculatorFind the gross amount needed so a bonus or payment leaves the exact net after taxes.Raise vs Inflation CalculatorCheck whether your raise beat inflation: real raise and purchasing power gain or loss.Severance Pay CalculatorEstimate your severance package from salary, years of service, PTO and bonus.Shift Differential CalculatorFind your night or weekend differential rate and weekly gross pay, with FLSA overtime.Tax Bracket CalculatorTax in each bracket, total tax, marginal and effective rate, with an editable bracket table.Tax Equivalent Yield CalculatorCompare tax-free municipal bond yields with taxable yields using your tax rates.Tip Pooling CalculatorSplit a tip pool among staff by hours, role points or percentages, with a tip-out sheet.Arizona Paycheck CalculatorArizona take-home pay: federal tax, FICA and the A-4 state withholding rate you choose.California Paycheck CalculatorCalifornia take-home pay after federal and CA income tax, Social Security, Medicare and SDI.Child Tax Credit CalculatorEstimate your child tax credit, refundable part and income phase-out for 2026 or 2025.Crypto Tax CalculatorUS tax on a crypto sale: short- or long-term gain tax from your income and filing status.Pension CalculatorDefined benefit pension: service × multiplier × final average salary, early reduction, COLA.Real Hourly Wage CalculatorFind your true pay per hour after taxes, commute time and costs, and unpaid work hours.Rideshare Driver Earnings CalculatorFind a rideshare or delivery driver's net pay per hour and per mile after fuel and car costs.RSU Tax CalculatorRSU vest income, 22%/37% withholding vs. your real bracket, tax shortfall and shares withheld.Social Security Break-Even CalculatorCompare claiming Social Security at 62, full retirement age or 70 and find your break-even ages.Total Compensation CalculatorAdd salary, bonus, equity, 401(k) match and benefits to see total comp and effective hourly value.After-Tax Return CalculatorInvestment return after taxes on interest, dividends and gains: taxable vs traditional vs Roth.AMT CalculatorAlternative minimum tax estimate with ISO bargain element, SALT add-back and phase-out.Charitable Donation Tax Deduction CalculatorHow much a donation saves on taxes and what it really costs you after the deduction.Colorado Paycheck CalculatorColorado take-home pay: federal tax, FICA, 4.4% state tax, FAMLI premium and Denver OPT.Child and Dependent Care Credit CalculatorDaycare tax credit by AGI and care costs for 2026 or 2025, compared with a dependent care FSA.Education Tax Credit CalculatorAmerican Opportunity vs Lifetime Learning credit from tuition, MAGI and filing status.Estate Tax CalculatorEstimate US federal estate tax: gross estate, deductions, gifts, exemption and portability.Gift Tax CalculatorAnnual exclusion, gift splitting, lifetime exemption, Form 709 check and gift tax due.Indiana Paycheck CalculatorIndiana take-home pay after federal tax, FICA, the flat state tax and county income tax.IRS Penalty CalculatorLate filing and late payment penalties plus interest on unpaid federal tax, month by month.Lifetime Earnings CalculatorTotal career earnings from starting salary, growth, career length and breaks, plus per hour.Marriage Penalty CalculatorFederal tax as two singles vs married filing jointly or separately: penalty or bonus.Maryland Paycheck CalculatorMaryland take-home pay after federal tax, FICA, MD brackets and your county income tax.Max 401(k) Per Paycheck CalculatorHow much to put in each paycheck (in $ and %) to max out your 401(k) by year-end.Medicare IRMAA CalculatorMedicare Part B and D income surcharges (IRMAA) from MAGI and filing status, 2026 and 2025.Minnesota Paycheck CalculatorMinnesota take-home pay after federal tax, FICA, MN brackets and the new Paid Leave premium.Nanny Tax CalculatorHousehold employer taxes for a nanny or caregiver: FICA, FUTA, state unemployment, per paycheck.QBI Deduction CalculatorSection 199A 20% QBI deduction with thresholds, SSTB phase-out and W-2 wage limit.Salary Growth Projection CalculatorProject your salary with yearly raises, promotions and inflation, plus total earnings.Salary Negotiation CalculatorCompare a job offer with your counteroffer and see the raise and lifetime earnings impact.Section 179 Deduction CalculatorFirst-year equipment write-off with Section 179, bonus depreciation, MACRS and tax savings.Social Security Earnings Limit CalculatorBenefits withheld when you work before full retirement age, using the 2026 earnings limits.Spousal Social Security CalculatorSpousal benefit up to 50% of your partner's PIA by claiming age, plus a survivor estimate.State Tax Comparison CalculatorCompare income, sales and property taxes for your household in two US states side by side.
See all 118 Tax & Paycheck Calculators →