How-to · Updated August 9, 2026
How to calculate capital gains tax on a property sale
Direct answer
Capital gains on sale of property ≈ sale price − selling expenses − adjusted basis. On a qualifying primary residence, Section 121 excludes up to $250,000 (single) or $500,000 (married filing jointly) of gain — so many home sales owe $0 federal capital gains tax. Tax applies to gain above the exclusion; rentals usually do not get the same break.
Capital gains tax on property sale — formula
- Gain ≈ sale price − selling expenses − adjusted basis
- Taxable gain ≈ max(0, gain − Section 121 exclusion)
- Federal CG tax ≈ taxable gain × your long-term rate (often 0%, 15%, or 20%) + depreciation recapture on rentals (up to 25%)
Worked examples (federal, educational)
| Scenario | Gain | Excluded | Est. federal CG tax |
|---|---|---|---|
| Married MFJ primary home: $700k sale, $400k basis, $30k costs | $270,000 | $270,000 | $0 |
| Single primary home: $650k sale, $300k basis, $25k costs | $325,000 | $250,000 | $11,250 on $75,000 taxable |
| Investment/rental: $400k sale, $60k depreciation, no Section 121 | $135,000 | $0 | $26,250incl. ~$15,000 recapture |
Honest limits: ignores Net Investment Income Tax (3.8%), state tax, partial exclusions, and filing-status edge cases. Not tax advice — confirm with IRS Pub 523 and a CPA.
Section 121 exclusion ($250k / $500k)
| Exclusion amount | Up to $250,000 (single / many MFS) or $500,000 (married filing jointly) |
| Ownership test | Owned the home for at least 2 years during the 5 years before the sale |
| Use (main home) test | Lived in it as your primary residence for at least 2 of the 5 years before the sale |
| Frequency | Generally cannot claim the full exclusion more than once every 2 years |
| Does not apply | Typical rental / investment sales (no automatic Section 121); conversions need special rules |
Short-term vs long-term capital gains
| Type | Holding period | Federal tax |
|---|---|---|
| Short-term | ≤ 1 year | Ordinary income rates (10%–37%) |
| Long-term | > 1 year | Preferential LTCG 0% / 15% / 20% |
| Depreciation recapture | Any (on rentals) | Up to 25% on prior depreciation |
State note — capital gains on property sale
| State | Treatment |
|---|---|
| California | Taxes gains as ordinary income (no preferential state LTCG) (Up to ~13.3%; planning ~9.3% on this site) |
| New York | Taxes gains as ordinary income (NYC local may add) (~6.85% state planning rate here) |
| Texas | No state income tax ($0 state CG tax — federal only) |
| Florida | No state income tax ($0 state CG tax — federal only) |
| New Jersey | Taxes gains as ordinary income (~6.37% planning (higher brackets possible)) |
| Illinois | Flat state income tax on gains (4.95% flat planning rate) |
Capital gains on home sale vs rental
- Primary home: Section 121 exclusion may wipe out most or all federal CG tax.
- Rental / investment: usually no Section 121; depreciation recapture up to 25% often applies.
- State tax: CA/NY tax taxable gains as ordinary income; TX/FL generally have $0 state income tax on the gain.
Use the free calculator
Model exclusion, depreciation recapture, and state variants: Capital gains tax on property sale calculator. Also: general capital gains.