Seller guide · 2026
Capital gains tax on a home sale, explained
Most US homeowners pay zero federal capital gains tax when they sell. This guide walks through the IRS Section 121 exclusion, how to calculate your adjusted cost basis, which selling expenses are deductible, and the exact formula behind the RealCalc seller net proceeds calculator.
TL;DR — the 30-second answer
Lived in the home 2 of the last 5 years? You can exclude up to $250,000 of profit if single, or $500,000 if married filing jointly. Only the excess is taxable, at long-term capital gains rates of 0%, 15%, or 20%.
1. The Section 121 exclusion ($250k / $500k)
Internal Revenue Code §121 lets you exclude gain on the sale of your primary residence — the home where you actually live most of the year — provided you meet two tests:
- Ownership test: you owned the home for ≥ 2 years out of the last 5.
- Use test: you used it as your main residence for ≥ 2 years out of the last 5 (months don't have to be consecutive).
The two windows can overlap and don't have to be the same 2 years. Investment properties, second homes, and short-term flips do not qualify.
Profit excluded from federal capital gains tax when ownership + use tests are met.
2. Calculate your adjusted cost basis
Your basis is what the IRS treats as your "investment" in the home. It's not just the purchase price — improvements add to it, and depreciation (if you ever rented part of it out or claimed a home office) reduces it.
Capital improvements add value or extend the home's useful life: a new roof, finished basement, addition, full kitchen remodel, HVAC replacement, solar panels, new driveway. Repairs (patching a leak, repainting, replacing a broken appliance) do not count.
- Purchase price$450,000
- Purchase closing costs$12,000
- Capital improvements$60,000
- Depreciation taken−$8,000
3. Subtract deductible selling expenses
The price on the contract isn't what you're taxed on — the IRS looks at your amount realized, which is the sale price minus the costs of selling.
Common deductible selling expenses:
- Real estate agent commissions (both sides)
- Title insurance and escrow / settlement fees
- State and local transfer or documentary taxes
- Recording fees and attorney fees
- Required repairs negotiated into the contract
- Reasonable staging costs
Mortgage payoff is not a selling expense — it affects your cash at closing, not your taxable gain.
4. The full formula
If the result is zero or negative, you owe no federal capital gains tax. If positive, that remainder is taxed at long-term capital gains rates (assuming you owned the home > 1 year, which is almost always true if you meet the §121 use test).
5. Worked example: married couple in California
- Sale price
- $1,350,000
- − Selling expenses (commission, title, transfer)
- −$95,000
- = Amount realized
- $1,255,000
- − Adjusted cost basis
- −$735,000
- = Raw gain
- $520,000
- − §121 exclusion (MFJ)
- −$500,000
- = Taxable federal gain
- $20,000
Despite a $520,000 raw gain, this couple pays zero federal capital gains tax after applying their cost basis, selling expenses, and the §121 exclusion. That's the typical outcome for long-tenured homeowners — even in expensive markets.
6. Long-term capital gains rates (2026)
When some gain is taxable, it's taxed at preferential long-term rates based on your total taxable income — not at your ordinary income rate.
| Rate | Single | Married filing jointly |
|---|---|---|
| 0% | Up to $48,350 | Up to $96,700 |
| 15% | $48,351 – $533,400 | $96,701 – $600,050 |
| 20% | Over $533,400 | Over $600,050 |
High earners may also owe a 3.8% Net Investment Income Tax on gains above $200k single / $250k MFJ modified AGI. State capital gains tax (e.g. California up to 13.3%) is separate.
7. Partial exclusions and edge cases
- Job, health, or unforeseen move before hitting 2 years: you get a prorated exclusion (e.g. 12 months ÷ 24 months × $250k = $125k for a single filer).
- Recently widowed: you can still claim the $500k MFJ exclusion if you sell within 2 years of your spouse's death and otherwise qualified jointly.
- Non-qualified use (years it wasn't your primary residence after 2008) reduces the eligible exclusion proportionally.
- Inherited home: basis is "stepped up" to fair market value at the date of death — there's often little or no gain when sold soon after.
- Loss on sale: a loss on a personal residence is not deductible — only investment-property losses are.
Estimate your net proceeds and tax exposure
The free RealCalc seller calculator pairs with the formula above: start with your gross sale price, factor in commissions, transfer taxes, and the mortgage payoff, then apply the §121 exclusion to see your true after-tax take-home.
This guide is general education, not tax advice. Confirm any specific situation with a CPA or tax attorney before filing.