Skip to main content

Calculator Documentation

Home Sale Capital Gains Calculator

Estimate the tax on your home sale, including the Section 121 exclusion

Schema version 1.0.0 · Category: investment

Inputs

The Sale

What you are selling for

FieldTypeDefaultNotes
Sale Pricecurrency$650,000Expected sale price
Selling Costscurrency$39,000Commission + closing costs (typically 6-8% of price)

Your Basis

What you have into the home

FieldTypeDefaultNotes
Original Purchase Pricecurrency$300,000What you paid for the home
Capital Improvementscurrency$50,000Renovations, additions, new roof (not repairs)
Depreciation Takencurrency$0If the home was ever a rental or home office. Recaptured at 25% and NOT excludable.

Section 121 Exclusion

Primary-residence exclusion

FieldTypeDefaultNotes
Filing Statusselect2Determines the exclusion cap
Lived There 2 of the Last 5 Years?select1Ownership AND use tests: 2 of the last 5 years as your primary residence

Adjustable Parameters

ParameterDefaultRangePurpose
Federal Capital Gains %150 - 23.80/15/20% by income, +3.8% NIIT for high earners
State Tax %50 - 14Your state income tax on gains (0 in TX/FL/WA and others)
Depreciation Recapture %2525 - 25Federal unrecaptured Section 1250 rate (fixed at 25%)

Calculations

Every figure this calculator produces, in evaluation order. Formulas reference input ids, parameters, and earlier calculations.

adjustedBasisAdjusted cost basis
purchasePrice + capitalImprovements - depreciationTaken
amountRealizedNet sale amount
salePrice - sellingCosts
totalGainTotal gain on the sale
max(amountRealized - adjustedBasis, 0)
recaptureAmountGain taxed as depreciation recapture (excluded from Section 121)
min(depreciationTaken, totalGain)
gainAfterRecaptureGain eligible for the exclusion
totalGain - recaptureAmount
exclusionAmountSection 121 exclusion ($250k x1 single, x2 married; 0 if not qualified)
qualifies121 * filingStatus * 250000
taxableGainGain subject to capital gains tax after the exclusion
max(gainAfterRecapture - exclusionAmount, 0)
recaptureTaxTax on depreciation recapture
recaptureAmount * recaptureRate / 100
capitalGainsTaxFederal + state tax on the taxable gain
taxableGain * (capitalGainsTaxRate + stateTaxRate) / 100
totalTaxTotal estimated tax on the sale
recaptureTax + capitalGainsTax
netAfterTaxWhat you keep after selling costs and taxes (before mortgage payoff)
amountRealized - totalTax
gainFullyExcludedFlag: 0 = entirely tax-free, 1 = some tax owed
if(totalTax > 0, 1, 0)

Put this calculator on your site

Every plan includes the Home Sale Capital Gains Calculator with your branding, share links, and PDF scenario reports.