When you sell your house for a profit, federal tax usually takes nothing. Section 121 of the Internal Revenue Code lets a single filer exclude up to $250,000 of gain and a married couple filing jointly up to $500,000, provided you owned and lived in the home long enough. Profit above the exclusion is taxed at long-term capital gains rates, which run from 0 to 20 percent depending on your income. Depreciation from a home office or rental, sales within a year of buying, and state income taxes can add to the bill.
Figure the Gain Before You Worry About the Tax
The taxable number is not the sale price minus the purchase price. The IRS starts with your adjusted basis and subtracts it from the amount realized.
Adjusted basis is what you paid for the home plus the cost of capital improvements. A new roof, a kitchen renovation, an added bathroom: those count. Painting and replacing a broken faucet don’t.
The amount realized is the sale price minus your selling expenses, including agent commissions, title insurance, legal fees, and transfer taxes. Combined buyer and seller agent commissions still average roughly 5 to 5.5 percent of the sale price nationally.1Board of Governors of the Federal Reserve System. Commissions and Omissions: Trends in Real Estate Broker Compensation
A worked example. You bought for $300,000, added $50,000 in improvements, and sold for $550,000 with $30,000 in selling costs. Amount realized is $520,000, adjusted basis is $350,000, and the gain is $170,000. That $170,000 is the figure the tax rules operate on.
The $250,000 and $500,000 Exclusion
Section 121 is the reason most home sellers pay no federal tax. A single filer can exclude up to $250,000 of gain; a married couple filing jointly can exclude up to $500,000.2Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
To claim the full exclusion, three tests must be met during the five-year period ending on the date of sale:
- Ownership. You owned the home for at least two of the five years. On a joint return, only one spouse needs to meet this test.
- Use. You lived in the home as your primary residence for at least two of the five years. On a joint return, both spouses must meet this test individually.
- Look-back. You haven’t used the Section 121 exclusion on another home sale within the two years before this sale.
The two years don’t need to be consecutive. Fourteen months, a break, and another ten months adds up to the 24 months required.3Internal Revenue Service. Publication 523 (2025), Selling Your Home The ownership and use periods can also fall at different times within the five-year window.4Internal Revenue Service. Topic No. 701, Sale of Your Home
The $500,000 joint exclusion has a wrinkle that catches couples off guard. Both spouses must independently meet the two-year residence test, and neither can have claimed the exclusion on another sale in the prior two years. If one spouse lived in the home for only 18 months, the couple doesn’t qualify for $500,000 on a joint return, though they may still claim $250,000 for the qualifying spouse.2Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Spouses who file separately each get their own $250,000 exclusion, but each must independently meet the ownership, use, and look-back tests for the home they sold.3Internal Revenue Service. Publication 523 (2025), Selling Your Home
Selling Early: The Partial Exclusion
If you sell before hitting two years, you may still get part of the exclusion when the sale is triggered by a change in employment, health problems, or certain unforeseen circumstances.5Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence
Take the shortest of three periods: how long you owned the home, how long you lived in it, or how long since you last used the exclusion. Divide by 24 months (or 730 days), then multiply by $250,000 (or $500,000 for joint filers). A single filer who lived in the home for 15 months before relocating for work gets 15 ÷ 24 × $250,000 = $156,250.3Internal Revenue Service. Publication 523 (2025), Selling Your Home
The IRS treats several situations as automatically qualifying, including job loss with unemployment eligibility, a death in the family, a natural disaster that damages the home, and the inability to afford the home after a change in employment or marital status. Circumstances outside those safe harbors, such as a pregnancy that made the home too small, have been approved case by case.
How Gain Above the Exclusion Is Taxed
Anything above your exclusion is taxable. The rate depends on how long you owned the home.
If you held it for one year or less, the excess is a short-term capital gain, taxed at ordinary income rates that run as high as 37 percent for top earners in 2026.6Internal Revenue Service. IRS Releases Tax Inflation Adjustments for Tax Year 2026 Short-term sales are uncommon, but they hit hard.
If you owned the home for more than a year, the excess qualifies for long-term capital gains rates.7Internal Revenue Service. Topic No. 409, Capital Gains and Losses For 2026:
- 0 percent on taxable income up to $49,450 (single), $98,900 (married filing jointly), or $66,200 (head of household).
- 15 percent above those thresholds up to $545,500 (single), $613,700 (married filing jointly), or $579,600 (head of household).
- 20 percent above the 15 percent ceiling.
The rates apply only to the gain above the exclusion. A single filer with a $350,000 gain pays long-term capital gains tax on $100,000, not the full $350,000.
The 3.8 Percent Surtax for High Earners
High earners face an additional 3.8 percent net investment income tax. The surtax applies to the smaller of your net investment income or the amount your modified adjusted gross income exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately).8Internal Revenue Service. Net Investment Income Tax Home-sale gain above the Section 121 exclusion counts as net investment income, so a high-income seller can face an effective rate of 23.8 percent on the taxable portion.
Depreciation Recapture From a Home Office or Rental
If you claimed depreciation for a home office or for renting out part of your property, that catches up with you at sale. The portion of gain equal to depreciation claimed after May 6, 1997, cannot be excluded under Section 121, no matter how well you meet the other tests.3Internal Revenue Service. Publication 523 (2025), Selling Your Home
The recaptured depreciation is taxed as unrecaptured Section 1250 gain at a federal rate of up to 25 percent. If you deducted $20,000 in depreciation over the years, you owe tax on that $20,000 at up to 25 percent even if your remaining gain is fully covered by the exclusion.
Rental or business use also cuts into the exclusion itself. Time when neither you nor your spouse used the property as a main home counts as nonqualified use, and gain allocated to those periods after 2008 does not qualify for the exclusion. The allocation is proportional: ten years of ownership with three years rented before you moved in leaves roughly 30 percent of the gain outside the exclusion. Nonqualified use after the last date you lived in the home doesn’t count against you.
Inherited Homes Work Differently
If the home came to you through an inheritance rather than a purchase, the basis rules change in your favor. Property received from someone who has died generally gets a basis stepped up to the fair market value on the date of death.9Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent A parent’s $80,000 purchase price is irrelevant if the home was worth $400,000 at death; your basis is $400,000, and a sale at $420,000 produces only $20,000 of gain.
Inherited property also gets automatic long-term treatment. Even a sale within months of inheriting qualifies for long-term capital gains rates.10Office of the Law Revision Counsel. 26 USC 1223 – Holding Period of Property The Section 121 exclusion is a separate matter: you still need two years of ownership and residence to claim it, so heirs who sell as-is rely on the stepped-up basis alone.
You Cannot Deduct a Loss
The rules aren’t symmetrical. A loss on the sale of a personal residence is not deductible and cannot offset capital gains from other investments.11Internal Revenue Service. What If I Sell My Home for a Loss The $3,000 annual capital loss deduction for investment assets does not apply. If you bought for $400,000, improved it by $50,000, and sold for $380,000, the $70,000 loss is simply gone.
Estimated Tax After the Sale
If your gain exceeds the exclusion, waiting until April to pay can trigger underpayment penalties. You generally need to make estimated payments if you expect to owe at least $1,000 for the year after withholding and credits, and your withholding won’t cover at least 90 percent of the current year’s tax or 100 percent of last year’s (110 percent if your prior-year adjusted gross income exceeded $150,000).12Internal Revenue Service. Large Gains, Lump Sum Distributions, Etc.
A large home-sale gain can push you past both thresholds in one quarter. The IRS lets you annualize income so you make the increased payment only for the quarter you closed in, rather than spreading it across all four quarterly deadlines. Publication 505 has the worksheet.
Reporting the Sale
The settlement agent typically issues Form 1099-S, reporting gross proceeds to you and the IRS.13Internal Revenue Service. Instructions for Form 1099-S (Rev. April 2025) If you receive one, you must report the sale on Schedule D of Form 1040 even when the entire gain is excluded.
There’s a shortcut. If the seller certifies in writing to the settlement agent that the home qualifies as a principal residence and the gain doesn’t exceed $250,000, the agent isn’t required to issue a 1099-S.13Internal Revenue Service. Instructions for Form 1099-S (Rev. April 2025) In that case the IRS generally doesn’t require you to report the sale. Keep the purchase records, improvement receipts, and closing statements anyway. If the IRS ever asks, that documentation is what proves the exclusion.
State Taxes Can Still Apply
Most states tax capital gains as regular income. A handful impose no income tax at all, and some that do conform to Section 121 or offer their own exclusion. Others don’t, so gain that’s federally tax-free can still generate a state bill. Check your state’s treatment before assuming the federal exclusion covers you completely.