Guidesfrom the federal index
Will I Owe Capital Gains Tax When I Sell My House? The Exclusion, Worked Through
Sale price minus selling costs minus what you have in the home is the gain. How the $250,000 and $500,000 exclusion applies, worked through on a real purchase.
The short answer
Most people who sell the home they live in owe nothing, because the tax code lets you leave up to $250,000 of the gain out of your income, or $500,000 on a joint return, if you owned the home and lived in it for two of the last five years. You owe tax only on the gain above that. A $310,000 purchase in March 2014 in ZIP 78704, sold at its indexed value of $604,811 with $36,289 of selling costs, has a gain of $258,523: $8,523 taxable on a single return, and $0 on a joint one.
The gain is not the price change
IRS Publication 523 defines the gain in three parts: the selling price, minus selling expenses, minus your adjusted basis. Basis is what you paid plus what you put into the home as improvements, things that add value or prolong its life, such as a roof, an addition or central air, plus certain closing costs when you bought. Repairs and paint do not count. So the gain is always smaller than the raw difference between the two prices, and every dollar of improvements you can document takes a dollar off it.
Gain = selling price − selling expenses − (price paid + improvements)
The exclusion
IRS Topic 701 sets the amount: up to $250,000, or $500,000 when you file jointly, if you pass two tests over the five years before the sale. You owned the home for at least 24 months, and you used it as your residence for at least 24 months. The months need not be the same ones or consecutive. You also cannot have excluded gain on another home in the two years before the sale. The amounts are written into the law and are not indexed to inflation, so a gain that would have been comfortably inside them in 1997 can now run past them in a ZIP that has doubled.
Taxable gain = gain − the smaller of the gain and the exclusion
Where the selling price comes from
Before a contract exists the selling price is an estimate. The capital gains check uses the index method: your price × (index now ÷ index at purchase) for the smallest area with data. For ZIP 78704 the annual index was 1529.73 in 2014 and 2984.51 in 2025, a factor of 1.95, so $310,000 becomes $604,811. Once you have a real offer, put it in the estimate’s place; the rest of the arithmetic is unchanged.
A worked example
You bought in March 2014 for $310,000 in ZIP 78704, made no improvements, and selling costs run 6% of the price.
- Selling price: $604,811, the ZIP estimate for 2025.
- Selling expenses: 6% × $604,811 = $36,289.
- Adjusted basis: $310,000 paid + $0 improvements = $310,000.
- Gain: $604,811 − $36,289 − $310,000 = $258,523.
- Single return: $258,523 − $250,000 excluded = $8,523 taxable.
- Joint return: the exclusion is $500,000, larger than the gain, so $258,523 is excluded and $0 is taxable.
Four things that change the answer
| Case | Selling price | Basis | Gain | Excluded | Taxable |
|---|---|---|---|---|---|
| ZIP estimate, single | $604,811 | $310,000 | $258,523 | $250,000 | $8,523 |
| ZIP estimate, joint | $604,811 | $310,000 | $258,523 | $258,523 | $0 |
| ZIP estimate, single, $40,000 of improvements | $604,811 | $350,000 | $218,523 | $218,523 | $0 |
| Texas estimate, single | $682,635 | $310,000 | $331,677 | $250,000 | $81,677 |
| ZIP estimate, single, tests not met | $604,811 | $310,000 | $258,523 | $0 | $258,523 |
Filing jointly, or documenting $40,000 of improvements, takes the taxable gain from $8,523 to $0. Reading the same purchase on the quarterly Texas index instead of the annual ZIP index (+120.2% through 2026 Q2 against +95.1% through 2025) puts the price at $682,635 and the taxable gain at $81,677, which is why the area level next to an estimate matters here more than anywhere. And failing the two-year tests makes the whole $258,523 taxable, unless the move was for work, health or an unforeseeable event, in which case Publication 523 allows a partial exclusion in proportion to the months you qualify.
What comes after the taxable amount
A home held more than a year is a long-term capital gain. The federal rate on it depends on your taxable income for the year, some states tax it as well, and a large gain can also bring in the net investment income tax. None of that can be worked out from the house alone, so the tool and this guide stop at the taxable amount. If you receive a Form 1099-S you must report the sale even when the whole gain is excluded. A loss on a home you lived in is not deductible.
What this estimate cannot know
- Your house. The selling price tracks the area’s average. Renovations, condition and lot are not in it, and a real offer can sit far from it.
- Sales the index never sees. The FHFA index is built from mortgages bought or guaranteed by Fannie Mae and Freddie Mac, so cash, jumbo, FHA and VA purchases are not in it (FHFA HPI FAQ).
- Your full tax picture. Purchase closing costs that add to basis, depreciation from a home office or rental years that reduce it, a prior exclusion, a divorce, a death, an inherited home and a like-kind exchange all change the answer under rules not modeled here.
- The future. The index is history and the rules are as of the review date. This is not an appraisal, not a forecast and not tax advice.
Sources
- IRS Topic no. 701, Sale of your home, the exclusion amounts and the ownership and use tests.
- IRS Publication 523 (2025), Selling Your Home, the gain computation, basis and the partial exclusion.
- FHFA House Price Index datasets, the annual ZIP file and the quarterly master file behind the value.
- FHFA HPI frequently asked questions, on what the index includes.
This guide is for informational purposes only. It is not an appraisal, and not financial, tax, lending or real-estate advice. Every estimate on this site tracks an area’s average, never a particular house. Confirm anything that matters with a licensed appraiser or your lender.
Last reviewed: September 2026 · Against IRS Topic 701 and Publication 523 (2025) for the rules, and the FHFA House Price Index (annual ZIP file dated March 31, 2026; master file through 2026 Q2) for the value.