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 tax = depreciation at ordinary rates (max 25%) + remaining gain at 0%, 15% or 20%, stacked on your other taxable income, + 3.8% NIIT if MAGI exceeds $200k single / $250k joint
Worked examples (federal, educational)
| Scenario | Gain | Excluded | Est. federal tax (2026) |
|---|---|---|---|
| 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 |
| Rental, single, $80k income: $400k sale, $300k cost, $60k depreciation | $135,000 | $0 | $26,318incl. $13,886 recapture + $1,182 NIIT |
Uses 2026 federal brackets with the gain stacked on other income and includes the 3.8% NIIT. State tax is not included here. Not tax advice — confirm with IRS Pub 523 and a CPA.
Section 121 exclusion ($250k / $500k)
| Exclusion amount | Up to $250,000 (single, head of household, each married-separate spouse) or $500,000 (married filing jointly) |
| Ownership test | Owned the home for at least 2 years (24 months) during the 5 years before the sale |
| Use (main home) test | Lived in it as your main home for at least 2 of the 5 years before the sale — the 2 years need not be continuous |
| $500,000 for couples | Either spouse meets the ownership test, both meet the use test, and neither used the exclusion in the prior 2 years |
| Frequency | Generally once every 2 years |
| Partial exclusion | Sold early because of a job move (50+ miles), health, or an unforeseen event: months qualified ÷ 24 × the limit |
| Depreciation | Depreciation taken after May 6, 1997 (home office, rental years) cannot be excluded — it is taxed up to 25% |
| Does not apply | Second homes, vacation homes, rentals, land, and flips; converted rentals may lose part of the exclusion for nonqualified use after 2008 |
Short-term vs long-term capital gains
| Type | Holding period | Federal tax |
|---|---|---|
| Short-term | 1 year or less | Ordinary income rates (10%–37%) |
| Long-term | More than 1 year | 0% / 15% / 20% |
| Unrecaptured §1250 (depreciation) | More than 1 year | Ordinary rate, capped at 25% |
| Net investment income tax | Any | +3.8% |
State note — capital gains on property sale
| State | Treatment |
|---|---|
| California | Ordinary income; 3⅓% escrow withholding unless exempt (13.3% top; 9.3% planning here) |
| New York | Ordinary income; NYC adds city tax (10.9% state + 3.876% NYC top; 6.85% planning) |
| New Jersey | Ordinary income; nonresident estimated payment at closing (10.75% top; 6.37% planning) |
| Illinois | Flat income tax on gains (4.95% flat) |
| Virginia | Ordinary income (5.75% top (over $17,000)) |
| Oklahoma | Ordinary income, but Oklahoma real property held 5+ years can be deducted (Form 561) (Often $0 on long-held OK property) |
| Washington | No income tax; the state capital gains tax exempts real estate ($0 on property sales) |
| Texas, Florida, Nevada, Tennessee, South Dakota, Wyoming, Alaska, New Hampshire | No state income tax on gains ($0 — federal only) |
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.
Related property-sale questions
Prior depreciation: how depreciation recapture is taxed. Sold before two years: the partial Section 121 exclusion.
Use the free calculator
Model exclusion, depreciation recapture, and state variants: Capital gains tax on property sale calculator. Also: general capital gains.