
Most homeowners never pay capital gains tax on home sale profits, because federal law lets you exclude up to $250,000 of profit ($500,000 for married couples filing jointly) when you sell your main home. But the exclusion has conditions, the profit is figured from your adjusted basis rather than what you paid, and gains above the limit are taxed at 2026 capital gains rates. This guide explains the rules for selling a house, how to calculate your gain, and what happens if you do not qualify for the full exclusion, with worked examples.
Quick answer: if you owned and lived in the home as your main residence for at least two of the five years before the sale, and have not used the exclusion in the past two years, you can exclude up to $250,000 of gain ($500,000 married filing jointly). Gain above that is usually taxed at 0%, 15% or 20%. Estimate yours with the capital gains tax calculator.
How capital gains tax on home sale profits works
When you sell a house for more than your adjusted basis, the profit is a capital gain. If you owned the home more than one year it is a long-term gain, taxed at the preferential rates below; one year or less, it is short-term and taxed like wages. For a main home, Section 121 of the tax code then lets you exclude a large part or all of that gain.
Adjusted basis = purchase price + buying costs + capital improvements − depreciation and certain credits
Gain = amount realized − adjusted basis
Taxable gain = gain − Section 121 exclusion
The $250,000 / $500,000 home sale exclusion
To claim the full exclusion, you must pass three tests:
- Ownership test: you owned the home for at least 24 months during the 5 years ending on the date of sale.
- Use test: you lived in it as your main home for at least 24 months in that same 5-year window. The months do not need to be consecutive, and the ownership and use periods do not need to overlap. Short absences such as vacations count as time living there.
- Look-back test: you did not exclude gain from another home sale in the 2 years before this sale.
Married couples filing jointly get up to $500,000 if either spouse meets the ownership test, both meet the use test, and neither used the exclusion in the prior two years. If only one spouse qualifies, the couple can exclude up to $250,000. A surviving spouse can still claim up to $500,000 if the home is sold within two years of the spouse's death and the other requirements were met just before the death.
The exclusion amounts are set in the law and are not adjusted for inflation. Proposals to raise or eliminate them have been introduced in Congress, but the One Big Beautiful Bill Act did not change Section 121, so the $250,000 and $500,000 limits apply for 2026. Members of the military, Foreign Service and intelligence community on qualified extended duty can elect to suspend the 5-year window for up to 10 years.
Calculating your gain: basis and improvements
Your gain is often much smaller than "sale price minus purchase price," because both sides get adjusted.
| Adds to basis (lowers gain) | Does not add to basis |
|---|---|
| Purchase price | Repairs and maintenance (painting, fixing leaks) |
| Settlement costs at purchase: title insurance, recording fees, transfer taxes, legal fees, survey | Mortgage interest, property taxes, homeowners insurance |
| Capital improvements: additions, new roof, HVAC, kitchen or bath remodel, landscaping, new windows | Points deducted as mortgage interest |
| Special assessments for local improvements (sidewalks, sewers) | Improvements later removed or replaced (the old roof's cost) |
Basis is reduced by any depreciation you claimed (for a home office or rental use), casualty losses deducted and certain energy credits. Keep closing statements and receipts for improvements for as long as you own the home, plus at least three years after you file the return reporting the sale. Inherited homes generally get a basis equal to fair market value at the date of death, which often wipes out most of the gain; gifted homes carry over the giver's basis.
Worked example: capital gains tax on home sale gains above the exclusion
A single filer bought a home for $300,000, paid $5,000 in buying costs, and spent $60,000 on improvements over the years. They sell for $780,000 and pay $45,000 in commissions and closing costs. They meet the 2-out-of-5-year tests and earn $95,000 in wages in 2026.
| Sale price | $780,000 |
| Selling costs | −$45,000 |
| Amount realized | $735,000 |
| Adjusted basis ($300,000 + $5,000 + $60,000) | −$365,000 |
| Gain | $370,000 |
| Section 121 exclusion (single) | −$250,000 |
| Taxable long-term gain | $120,000 |
| Ordinary taxable income (wages − $16,100 standard deduction) | $78,900 |
| Capital gains tax (gain stacked on top of ordinary income) | $18,000 |
| Net investment income tax (3.8% on MAGI above $200,000) | $570 |
| Total federal tax on the sale | $18,570 |
The gain sits on top of the seller's $78,900 of ordinary taxable income. Because that is already above the $49,450 top of the 0% bracket, the whole $120,000 falls in the 15% bracket. The 3.8% net investment income tax applies only to the $15,000 by which modified AGI exceeds $200,000. Excluded gain does not count toward the NIIT. The capital gain also raises AGI, which can affect other items such as credits and Medicare premiums.
Same sale, married filing jointly: if both spouses lived in the home for two of the last five years, the exclusion is $500,000, which covers the entire $370,000 gain. Taxable gain: $0.
2026 capital gains tax rates
Taxable gain from a home held more than a year uses the long-term rates. The thresholds apply to total taxable income, including the gain:
| Rate | Single | Married filing jointly | Head of household |
|---|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 | Up to $66,200 |
| 15% | $49,451 – $545,500 | $98,901 – $613,700 | $66,201 – $579,600 |
| 20% | Over $545,500 | Over $613,700 | Over $579,600 |
High earners may also owe the 3.8% net investment income tax on the taxable portion of the gain. Many states tax capital gains as ordinary income, so check your state's rules too.
Partial exclusion if you sell early
If you fail the 2-year tests or used the exclusion within the past two years, you may still get a reduced exclusion if the main reason for the sale was:
- A change in place of employment: a safe harbor applies if your new job location is at least 50 miles farther from the home than your old one (or 50 miles away if you had no job before).
- Health: moving to obtain or provide care for a disease, illness or injury, for yourself or a family member, often documented by a doctor's recommendation.
- Unforeseen circumstances: events such as death, divorce or legal separation, multiple births from one pregnancy, losing a job and qualifying for unemployment, a casualty or disaster damaging the home, or condemnation.
The reduced limit is the full exclusion multiplied by the qualifying months (the shorter of your ownership, use, or time since the last exclusion) divided by 24.
Example: a single owner lives in a home for 15 months, then takes a job 300 miles away and sells at a $180,000 gain. Maximum exclusion = $250,000 × 15/24 = $156,250. Taxable gain = $23,750. Note that the fraction reduces the dollar limit, not the gain itself, so a smaller gain can still be fully excluded.
Home office, rental use and depreciation recapture
Depreciation claimed after May 6, 1997 for business or rental use of the home cannot be excluded. That amount, called unrecaptured Section 1250 gain, is taxed at your ordinary rate up to a maximum of 25%. For example, if you deducted $30,000 of depreciation on a home office or while renting out the house, up to $30,000 of the gain is taxable at a rate of up to 25% (at most $7,500), even if the rest is fully excluded.
- Home office inside the home (a spare bedroom): no need to split the gain, but the depreciation is taxable. The home office deduction calculator compares the simplified method, which involves no depreciation, with the regular method.
- Separate structure (a detached studio or rental unit): you allocate the gain between the residence and the business part; only the residential part can be excluded.
- Rental before it was your home: for periods after 2008 when the property was not your main home (nonqualified use), a proportional share of the gain is not excludable. Time after you move out, within the 5-year window, generally does not count as nonqualified use.
Depreciation schedules are covered in the depreciation calculator.
A loss on a personal home is not deductible. If you sell your main home for less than your adjusted basis, you cannot deduct the loss. Losses on rental or business property follow different rules.
Reporting the sale and Form 1099-S
The closing agent usually files Form 1099-S to report the gross proceeds. They can skip it if you certify in writing that the full gain is excludable, which generally requires a sale price of $250,000 or less ($500,000 for married sellers) and that you meet the exclusion rules.
- Entire gain excluded and no 1099-S: you generally do not report the sale at all.
- You received a 1099-S, or part of the gain is taxable: report the sale on Form 8949 and Schedule D, entering the exclusion as an adjustment (code H) so that only the taxable part is taxed.
- Depreciation was claimed: the business part may also go on Form 4797.
If a large gain will be due, consider making an estimated tax payment for the quarter of the sale to avoid an underpayment penalty; see Quarterly Taxes 101. For how a gain interacts with your other income, see how much federal income tax will I pay, and for filing-status trade-offs, married filing separately vs jointly.
Frequently asked questions
How do I avoid capital gains tax on home sale profits?
Live in the home as your main residence for at least two of the five years before selling and do not use the exclusion more than once every two years. That lets you exclude up to $250,000 of gain ($500,000 married filing jointly). Keeping records of improvements and selling costs also lowers the gain subject to capital gains tax on home sale proceeds.
Do I have to pay capital gains tax if I buy another house?
No rule requires reinvesting the proceeds, and buying another home does not defer tax. That rollover rule was repealed in 1997 and replaced by the $250,000/$500,000 exclusion. (A 1031 exchange applies only to investment or business property, not a main home.)
What is the capital gains tax rate on a home sale in 2026?
Taxable gain on a home owned more than one year is taxed at 0%, 15% or 20%, depending on taxable income. For 2026, the 0% rate applies up to $49,450 of taxable income for single filers ($98,900 joint) and 20% starts above $545,500 ($613,700 joint). The 3.8% NIIT may also apply.
What if I lived in my house less than 2 years?
You may qualify for a partial exclusion if you sold because of a job change at least 50 miles farther away, health reasons or unforeseen circumstances. The limit is prorated by the months you qualified divided by 24. Otherwise the gain is taxable, at short-term rates if you owned the home a year or less.
Do I have to report the sale of my home to the IRS?
If the entire gain is excludable and you did not receive Form 1099-S, you generally do not need to report it. If you received a 1099-S or any gain is taxable, report the sale on Form 8949 and Schedule D.
At what age do you not pay capital gains on a home sale?
There is no age-based exemption today. The over-55 one-time exclusion was replaced in 1997 by the $250,000/$500,000 exclusion, which is available at any age, as often as every two years.
Further reading for investors
Affiliate picksAs an Amazon Associate, CPA Calculator earns from qualifying purchases, at no extra cost to you. We don’t accept payment for recommendations, and they never affect calculator results.


