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
| Field | Type | Default | Notes |
|---|---|---|---|
| Sale Price | currency | $650,000 | Expected sale price |
| Selling Costs | currency | $39,000 | Commission + closing costs (typically 6-8% of price) |
Your Basis
What you have into the home
| Field | Type | Default | Notes |
|---|---|---|---|
| Original Purchase Price | currency | $300,000 | What you paid for the home |
| Capital Improvements | currency | $50,000 | Renovations, additions, new roof (not repairs) |
| Depreciation Taken | currency | $0 | If the home was ever a rental or home office. Recaptured at 25% and NOT excludable. |
Section 121 Exclusion
Primary-residence exclusion
| Field | Type | Default | Notes |
|---|---|---|---|
| Filing Status | select | 2 | Determines the exclusion cap |
| Lived There 2 of the Last 5 Years? | select | 1 | Ownership AND use tests: 2 of the last 5 years as your primary residence |
Adjustable Parameters
| Parameter | Default | Range | Purpose |
|---|---|---|---|
| Federal Capital Gains % | 15 | 0 - 23.8 | 0/15/20% by income, +3.8% NIIT for high earners |
| State Tax % | 5 | 0 - 14 | Your state income tax on gains (0 in TX/FL/WA and others) |
| Depreciation Recapture % | 25 | 25 - 25 | Federal 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.