Capital Gains Tax on a Home Sale: Exclusions, Rates, and Surtax

When you sell your main home, federal law lets you exclude up to $250,000 of profit from capital gains tax if you file singly, or up to $500,000 if you’re married filing jointly.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence For most sellers, that wipes out the capital gains tax on a home sale entirely. Anything above the exclusion, or gain on a home that doesn’t qualify, is taxed as a capital gain at federal rates that depend on how long you owned the property and how much you earn.

Figuring Out Your Gain

Your gain is not the sale price minus what you paid. It’s the sale price minus your adjusted basis and your selling costs.

Basis starts with the original purchase price of the home.2Office of the Law Revision Counsel. 26 USC 1012 – Basis of Property-Cost You then adjust it upward for permanent improvements you made over the years, such as a new roof, a kitchen renovation, or an added deck.3Office of the Law Revision Counsel. 26 USC 1016 – Adjustments to Basis Routine maintenance and repairs don’t count. Selling expenses that reduce your gain include agent commissions, title insurance, transfer taxes, and legal fees.

Your mortgage balance is irrelevant to this math. A seller with a $300,000 payoff and $200,000 of gain still has $200,000 of gain, not a loss.

The Two-Year Ownership and Use Tests

To claim the exclusion, you have to pass two tests during the five-year period ending on the sale date.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence You must have owned the home for at least two of those five years, and you must have used it as your principal residence for at least two of those five years. The two years don’t have to be consecutive, and the ownership and use periods don’t have to line up.

Single filers who pass both tests exclude up to $250,000 of gain. Married couples filing jointly exclude up to $500,000 if both spouses meet the use test and at least one meets the ownership test. Your principal residence is where you spend the majority of your time; the IRS looks at your mailing address, voter registration, and workplace to confirm it. The home itself can be a house, condo, co-op, or houseboat.

A surviving spouse who is unmarried at the time of sale can still use the $500,000 limit if the sale happens within two years of the spouse’s death and the couple would have qualified immediately before the death.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Miss that window and the available exclusion drops by $250,000 for good.

Members of the uniformed services, the Foreign Service, and the intelligence community can suspend the five-year test period for up to ten years while on qualified extended duty.4Internal Revenue Service. Publication 523, Selling Your Home Without that suspension, a long deployment would knock most service members out of the exclusion.

Partial Exclusion When You Sell Early

If you sell before hitting the full two years, you may still qualify for a prorated exclusion when the move is for a job, for health reasons, or because of certain unforeseen events.4Internal Revenue Service. Publication 523, Selling Your Home

  • Job relocation qualifies when your new workplace is at least 50 miles farther from the home than your old workplace was.
  • Health moves qualify when you or a family member moved to get medical diagnosis, treatment, or ongoing care. A doctor’s recommendation helps but isn’t required.
  • Unforeseen events include divorce, legal separation, the death of a co-owner, job loss, and a multiple birth from the same pregnancy.

The math: divide the months you actually lived in the home (up to 24) by 24, then multiply by $250,000 or $500,000. A single owner who lived in the home 12 months before a qualifying job move can exclude up to $125,000.4Internal Revenue Service. Publication 523, Selling Your Home

You Can Only Use the Exclusion Every Two Years

You cannot claim the principal residence exclusion more than once in any 24-month period.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence The IRS counts from closing date to closing date. If you claimed it on a prior sale less than two years ago, the second sale is fully taxable no matter how well you meet the ownership and use tests. House flippers almost never qualify because both this rule and the two-year residency test cut against them.

What Rate Applies to Gain Above the Exclusion

Any profit above your available exclusion is a taxable capital gain. If you owned the home for more than one year, that gain is long-term and taxed at 0%, 15%, or 20%, depending on your taxable income and filing status.5Internal Revenue Service. Topic No. 409, Capital Gains and Losses Own it a year or less and the gain is short-term, taxed as ordinary income, which can reach 37%.

Most home sellers land in long-term territory. The 0% bracket is worth checking closely, because if your total taxable income including the gain stays under the threshold, the taxable portion also comes in at zero. For 2026, the 0% rate reaches roughly $49,450 of taxable income for single filers and about $98,900 for joint filers, with the 15% rate covering most middle and upper-middle incomes above that and 20% applying at the top.

The 3.8% Surtax for Higher Earners

A 3.8% net investment income tax applies to capital gains, including taxable home sale gain, when your modified adjusted gross income exceeds $200,000 (single), $250,000 (joint), or $125,000 (married filing separately).6Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax These thresholds are not indexed for inflation.

Gain that’s excluded under the principal residence exclusion is not counted as net investment income for this surtax.7Internal Revenue Service. Questions and Answers on the Net Investment Income Tax Only the taxable portion is exposed. The surtax then applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold.

If the Home Was Ever a Rental or Home Office

Rental use and business use change the calculation in two ways that catch sellers off guard.

Depreciation Recapture

Depreciation you claimed (or could have claimed) during rental or business use reduces your basis. When you sell, the portion of gain equal to depreciation taken after May 6, 1997 cannot be excluded and is taxed at a maximum rate of 25%.4Internal Revenue Service. Publication 523, Selling Your Home5Internal Revenue Service. Topic No. 409, Capital Gains and Losses Sellers who converted a rental back into a primary residence often assume the exclusion swallows everything. It doesn’t swallow depreciation.

Nonqualified Use

Time you owned the home but did not use it as your primary residence, such as a period when it was rented, is nonqualified use. The gain allocated to those periods cannot be excluded.1Office of the Law Revision Counsel. 26 USC 121 – Exclusion of Gain From Sale of Principal Residence Divide the nonqualified period by your total ownership period, and that fraction of the gain is ineligible. Periods before January 1, 2009 are ignored.

Some time doesn’t count against you. Qualified military duty (up to ten years) is not nonqualified use. Temporary absences of up to two years for job, health, or unforeseen circumstances are excluded. And any time after your last period of use as a primary residence but before the sale doesn’t count either. So if you lived in the home three years, then rented it for a year and sold, that final rental year isn’t nonqualified use.

Inherited Homes Get a Stepped-Up Basis

If you inherited the home, your basis is not what the prior owner paid. It resets to the home’s fair market value on the date of death.8Office of the Law Revision Counsel. 26 USC 1014 – Basis of Property Acquired From a Decedent A home bought decades ago for $80,000 and worth $400,000 at death gives you a $400,000 basis; sell for $410,000 and the taxable gain is $10,000. Inherited property is automatically treated as long-term regardless of how quickly you sell.

Losses on a Personal Home Are Not Deductible

If you sell for less than your adjusted basis, you cannot deduct the loss.5Internal Revenue Service. Topic No. 409, Capital Gains and Losses The IRS treats a primary residence as personal-use property, and losses on personal-use property never get tax relief. The exclusion only helps on the upside.

How to Report the Sale

The closing agent typically issues Form 1099-S showing gross proceeds and the closing date.9Internal Revenue Service. Instructions for Form 1099-S If your entire gain is excluded and you meet all the requirements, the settlement agent may not issue one, and you generally don’t need to report the sale at all.

When some or all of the gain is taxable, report it on Form 8949 as short-term or long-term based on your holding period. Any excluded portion goes in column (g) as a negative adjustment.10Internal Revenue Service. Instructions for Schedule D (Form 1040) Totals flow to Schedule D. Depreciation recapture may require Form 4797. Keep your closing statement, improvement records, and any 1099-S for at least three years, which is the standard audit window.