Capital Gains Tax on a Home Sale When Your Gain Is Over the Exclusion
Who qualifies for the exclusion, and how much it covers
Under IRC 121, you exclude gain on the sale of your principal residence if, during the five years ending on the sale date, you owned it for at least two years and used it as your main home for at least two years. The two years do not need to be consecutive, and ownership and use do not need to overlap. You cannot have used the exclusion on another home in the two years before this sale (IRC 121(b)(3)).
The cap is $250,000 per person. Married couples filing jointly get $500,000 if either spouse meets the ownership test, both meet the use test, and neither used the exclusion in the prior two years (IRC 121(b)(2)). These amounts were set in 1997 and are not indexed for inflation, which is why so many long-time owners in coastal markets now have gain above them. Excluded gain is simply left out of income: it is not reported as tax owed, and it does not count toward the 3.8% tax.
How the gain above the exclusion is taxed
Start with the amount realized (price minus commissions and other selling costs), subtract adjusted basis (purchase price, purchase closing costs and capital improvements), then subtract the exclusion. What remains is long-term capital gain if you owned the home more than a year. Federal rates are 0%, 15% or 20%, with 20% above $613,700 of taxable income for joint filers (Rev. Proc. 2025-32, 2026); the capital gains hub has the full table.
Because the excluded part is not in taxable income, the taxable gain stacks on top of your other income. In the first example, the federal income tax caused by the sale is $170,785 and the 3.8% net investment income tax adds $34,200. A residence is not a trade or business asset, so the taxable gain is net investment income once modified AGI exceeds $250,000 joint or $200,000 single (IRC 1411, fixed thresholds, 2026). The NIIT on a sale analysis shows how timing can limit it.
Basis is where most owners leave money behind. Thirty years of kitchens, roofs, additions, solar and landscaping add up, and each documented dollar reduces gain above the exclusion one for one. See adjusted basis for what counts.
The state layer: California vs Texas
Most states follow the federal exclusion and then tax the gain above it as ordinary income. California has no lower rate for capital gains, so the taxable part is taxed at up to 12.3%, plus 1% on income over $1 million (California FTB, 2026). Texas has no personal income tax. Same couple, same house economics: the California version costs $296,498, the Texas version $204,985, a state gap of $91,513.
Moving before you sell does not help much with a house: the state where the home sits taxes the gain as its own source income. Planning a move for other reasons? Read the residency change analysis and the California page first.
Widows and widowers: the two-year $500,000 window
A surviving spouse who has not remarried keeps the $500,000 cap if the home is sold within two years after the spouse's death and the joint-filer requirements were met immediately before the death (IRC 121(b)(4), in effect since 2008). After the second anniversary, the cap falls to $250,000.
The death also changes the gain itself. Property included in the deceased spouse's estate gets a basis equal to its value at death (IRC 1014). For a jointly owned home in a common-law state that is usually half the house; in community property states such as California, both halves can be stepped up under IRC 1014(b)(6). In our examples the widow's gain is $750,000 after that step-up. Selling within two years costs $67,210; waiting into year three costs $150,297, a difference of $83,087 from the calendar alone.
Sold before two years? The partial exclusion
If you sell before meeting the two-year tests because of a change in place of employment, health, or unforeseen circumstances, you get a reduced cap rather than none (IRC 121(c)). The regulations multiply the full $250,000 or $500,000 by the qualifying months divided by 24 (Treas. Reg. 1.121-3(g)). Example 1 in that regulation: 12 months, a job move, a $125,000 cap for a single owner.
The regulation's safe harbors for unforeseen circumstances include involuntary conversion of the home, a disaster or casualty to it, and for you or a household member: death, unemployment, a change in employment that leaves you unable to pay housing costs, divorce or legal separation, and multiple births from one pregnancy (Treas. Reg. 1.121-3(e), current). A sale driven by wanting a nicer house or a better financial position does not qualify.
Depreciation and the home office
Depreciation you claimed (or could have claimed) after May 6, 1997 is never excluded (IRC 121(d)(6)). It comes back as unrecaptured Section 1250 gain taxed at up to 25% (IRC 1(h)(1)(E), 2026). Typical sources: a home office deducted on Schedule C, or years the house or a unit was rented.
How much else is taxable depends on where the office was. If the office was inside the dwelling unit, no allocation is needed and only the depreciation is taxed. If it was a separate structure, like a detached studio, the gain on that portion is not excluded at all (Treas. Reg. 1.121-1(e)). Former rentals have a further limit on periods of nonqualified use after 2008; that rule is covered on our second home page.
Ways to manage the gain above the exclusion
- Time the sale year. Taxable gain stacks on your other income, so a year with lower wages or after retirement can keep more of it in the 15% bracket. See year-end timing.
- Sell on terms. A Section 453 installment sale applies the exclusion first and then spreads the remaining gain across the years you are paid. A buyer's note should be secured by a first-position deed of trust on the home.
- Offset with losses. Capital losses and carryforwards offset the taxable gain; suspended passive losses from rentals do not, because home sale gain is not passive income. See loss carryovers.
- If part was a rental. The Section 121 and 1031 combination can exclude and defer in one sale.
To see your exclusion, state tax and installment options modeled together, get the Big Sale Tax Analysis.
What to know
The exclusion is generous but frozen at 1997 levels, so long-time owners in expensive markets should expect a real bill on the excess. Records matter: improvements you cannot document will not reduce gain, and depreciation is taxed whether or not you claimed it. Waiting past a deadline, such as the two-year window after a spouse's death, can cost more than any market move gains.
Worked example
Bought decades ago, $1,400,000 of gain after improvements, $500,000 excluded, $900,000 taxable. $250,000 of other income. Identical gain and income, but Texas has no personal income tax. California widow, $120,000 of other income, $750,000 of gain after the death-date basis step-up, $500,000 excluded under IRC 121(b)(4), $250,000 taxable. Same $750,000 gain, but the sale is more than 2 years after the death, so the exclusion drops to $250,000 and $500,000 is taxable.
| Engine run | Married couple, California | Same couple, Texas | Widow sells within 2 years | Same widow, sells in year 3 |
|---|---|---|---|---|
| Filing status | Married, joint | Married, joint | Single | Single |
| State | California | Texas | California | California |
| Other income (wages, pension, interest) | $250,000 | $250,000 | $120,000 | $120,000 |
| Long-term capital gain | $900,000 | $900,000 | $250,000 | $500,000 |
| Federal income tax on the sale | $170,785 | $170,785 | $37,500 | $83,724 |
| Net investment income tax (3.8%) | $34,200 | $34,200 | $6,460 | $15,960 |
| State income tax on the sale | $91,513 | $0 | $23,250 | $50,613 |
| Total tax caused by the sale | $296,498 | $204,985 | $67,210 | $150,297 |
| Effective rate on the gain | 32.9% | 22.8% | 26.9% | 30.1% |
| Gain kept after these taxes | $603,502 | $695,015 | $182,790 | $349,703 |
Computed October 7, 2026 by the Big Sale Tax engine (engine.js yearTax): federal brackets, 0/15/20% thresholds and AMT from Rev. Proc. 2025-32 (OBBBA-adjusted) and the One Big Beautiful Bill Act (P.L. 119-21); NIIT under IRC 1411 (thresholds not indexed); state tax from the engine's state table (where a state has not yet published 2026 brackets, its 2025 table is used and labeled projected). "Tax caused by the sale" = tax with the sale minus tax without it. Excludes selling costs, local taxes and estimated-tax timing. Education only.
Run your own numbers
2026 law from the engine: federal 0/15/20% brackets (Rev. Proc. 2025-32), 25% cap on unrecaptured 1250 gain, ordinary rates on 1245 recapture, 3.8% NIIT over $200,000 single / $250,000 joint (IRC 1411), AMT, and your state's rules. Tax shown is the tax caused by the sale. Excludes selling costs, local taxes and NIIT exceptions for active business owners. Education only.
Long-Term vs Short-Term Capital Gains (2026)
The one-year holding rule, the 2026 0/15/20% thresholds for every filing status, NIIT, recapture, the state layer and a worked $200,000 example: 11 months vs 13 months, and what spreading the gain can save.
Frequently asked questions
How do I avoid capital gains tax when selling a house in California?
Does California have its own capital gains tax rate?
What is the capital gains tax rate on real estate in Los Angeles?
What happens if my home sale gain is more than $500,000?
Can a widow get the $500,000 exclusion?
Do I have to report a home sale if the gain is under the exclusion?
Sources
- IRC 121 (Cornell LII)
- Treas. Reg. 1.121-1 (eCFR)
- Treas. Reg. 1.121-3 (eCFR)
- IRS Topic No. 701, Sale of your home
- IRS Publication 523, Selling Your Home
- IRC 1014 (Cornell LII)
- IRC 1411 (Cornell LII)
- California FTB: capital gains and losses
- Rev. Proc. 2025-32 (IRS)
- IRS Form 8949
Figures as of October 7, 2026; each rate and limit above names its source and year. Education only, not legal or tax advice.
Keep reading
Second home
A vacation home gets no Section 121 exclusion, but rental history, a 1031 safe harbor or moving in can change the bill.
ReadAdjusted basis
How to build adjusted basis from your records, what goes in and what never does, inherited versus gifted basis, partnership and S corporation basis, and what a
ReadInherited property
Heirs start from the value on the date of death, so a quick sale often produces little gain. The exceptions are where the tax hides.
ReadCalifornia
No capital gains rate, a 1% surcharge over $1M, its own depreciation and QSBS rules, and a long reach after you move.
ReadInstallment sale (Section 453)
Report the gain as the buyer pays you instead of all in the year of sale, under rules that have been in the tax code for decades.
ReadSection 121 plus 1031
A former home that became a rental can use both the home sale exclusion and a 1031 exchange on the same sale under Rev. Proc. 2005-14.
ReadKnow your number before you sign.
The Big Sale Tax Analysis is a flat $5,000. Start with a free scoping call; you are invoiced only after it, and only if you go ahead.
Prefer email? Request the analysis by email.