The 2026 Guide: How to Avoid Capital Gains Tax on a House

Michael Warford's Photo
By Michael Warford Updated October 19, 2026
's Photo
Edited by Cara Haynes

SHARE

Imagine you bought a home in 2015 for $380,000 and you’re now selling it for $640,000. If you're married and file jointly, you'll likely owe nothing on it. If you're single, you could owe tax on $10,000 unless you can first reduce your gain.

The good news is that tax deductions and exclusions mean many home sellers don’t have to pay any capital gains taxes. But of course, you’ll need to qualify for that exclusion, and knowing how to do so can lead to confusion and stress.

This article explains how to qualify for the exclusion, what counts toward your cost basis, and how your income and situation affect your tax bill. You can also run your numbers with our capital gains tax calculator. But this article is for general information only. For advice on your situation, talk to a CPA before you list.

How capital gains tax works on a home sale

Capital gains tax only applies to the profit you make when you sell your house, and not the full sale price. Your gain is the difference between your sale price (minus selling costs) and your cost basis, which is what you paid plus improvements and certain buying costs.

How long you owned the home matters. If you held it for one year or less, the gain is short-term and taxed as ordinary income, at up to 37%. If you held it for more than a year, the gain is long-term and taxed at 0%, 15%, or 20%, depending on your filing status and total taxable income.[1]

Here’s how the income brackets for long-term gains break down for the 2026 tax year:[2]

RateSingle filersMarried filing jointlyMarried filing separately
0%Up to $49,450Up to $98,900Up to $49,450
15%$49,451-$545,500$98,901-$613,700$49,451-$306,850
20%Over $545,500Over $613,700Over $306,850
Show more

Also, if you have a modified adjusted gross income above $200,000 (for single filers) or $250,000 (for married, joint filers) you may also owe an additional 3.8% Net Investment Income Tax (NIIT) on any gains that exceed the excluded amount.[3] We cover it in more detail below.

Capital gains tax calculator

Home Sale Capital Gains Calculator

Estimate the taxable gain on your home sale. Numbers below reproduce the worked example — replace them with your own.

Owned & lived in the home 2 of the last 5 years?

Determines whether you qualify for the Section 121 exclusion.

What you originally paid for the home.

Value-adding upgrades (remodels, additions, new roof) — not routine repairs.

Typical Clever costs — tap to add: Typical U.S. costs — Clever Real Estate analysis (remodels: JLC Cost vs. Value 2024; services: Thumbtack/HomeAdvisor).

The price the home sold for.

Agent commission, title/escrow, attorney, staging, transfer taxes.

Typical Clever costs — tap to add: Typical U.S. costs — Clever Real Estate analysis (remodels: JLC Cost vs. Value 2024; services: Thumbtack/HomeAdvisor). Commission: Clever transaction data.

Taxable capital gain

$35,000

About $35,000 of your gain may be taxable after the $250,000 exclusion.

Amount realized (sale price − selling expenses)
$675,000
Adjusted basis (purchase price + improvements)
$390,000
Gross capital gain
$285,000
Section 121 exclusion applied
−$250,000
Taxable capital gain
$35,000

Exclusion limits ($250,000 single / $500,000 married filing jointly) as of 2025.

See how much you'd save on agent commission

This calculator provides a simplified estimate for a primary residence and is not tax advice. It doesn't cover second homes, rental/investment property (including depreciation recapture), state taxes, the 3.8% Net Investment Income Tax, or partial-exclusion situations. Confirm your numbers with a CPA and IRS Publication 523.

The primary residence exclusion and how to qualify

If you just got a 1099-S in the mail, don't panic. There's a good chance you won't owe anything, thanks to the primary residence exclusion.

Essentially, the primary residence exclusion allows you to exclude up to $250,000 of gain (for single filers) or $500,000 (for married joint filers) off your federal income taxes.[4] If the capital gains you made from your sale are less than those amounts, you won’t owe any capital gains tax.

However, to qualify you’ll need to meet three tests:[5]

  1. Ownership test: You must have owned the property for at least two years in the past five years. Those two years don’t have to be consecutive.
  2. Use test: You lived in the home as your main home for at least two of the five years before the sale. Again, the years don't have to be in a row. This test is why many rental properties don't qualify.
  3. Look-back test: You can only claim the primary residence exclusion once every two years. If you’ve already used it in the last two years, you’re not eligible.

If you split your time between two homes, only one can be your main home. The IRS looks at the facts, mainly where you spend most of your time. The address on your tax return, driver's license, and voter registration helps support it.

To understand how the primary residence exclusion actually impacts your tax bill, let's take two examples.

Scenario A: A seller bought a house in 2016 for $350,000 and sold it in 2026 for $600,000, a $250,000 gain. That's right at the $250,000 single-filer limit, so they owe nothing.

Scenario B: The seller also purchased their house in 2016 for $300,000 and sold it in 2026 for $800,000, resulting in a $500,000 gain. Whether they owe depends on filing status. A single filer would owe tax on $250,000. A married couple filing jointly would owe nothing, because their exclusion is $500,000.

The $250,000 and $500,000 limits haven't changed since 1997. Bills in Congress would raise them, but none have passed, so plan around the current limits. Our guide to whether you pay taxes when you sell your house covers the proposals and the full exclusion rules.

Other ways to reduce your capital gains tax

While the primary residence exclusion is usually your most powerful tool for reducing your capital gains tax, it’s not the only one. Here are other practical strategies to minimize what you owe if your gains exceed the primary residence exclusion limits.

Increase your cost basis with home improvements

Your cost basis is essentially the amount you paid for your house plus the value of any qualifying improvements.

A qualifying improvement adds value to your home or extends its life, like a room addition, a finished basement, or a new roof. Routine repairs and maintenance, like fixing a leaky faucet, painting, or patching a roof, don't count.

"When you sell a home, you pay tax on your profit. But you can lower that profit by adding the cost of big improvements, like a new roof, kitchen remodel, or new heating system," says Ashley Akin, a CPA, tax consultant, and senior contributor at CEP DC.

Having a higher cost basis is good for tax purposes because when your cost basis is higher, you are more likely to stay below the primary residence exclusion.

Say you bought a house for $300,000, then added a $60,000 kitchen remodel and a $20,000 roof replacement. Your cost basis is now $380,000. If you sell for $630,000, your gain is $250,000, which a single filer can fully exclude. Without those improvements counted, your gain would be $330,000, and $80,000 of it would be taxable.

You'll need proof. Save receipts, contractor invoices, and permit records for every improvement.

"Many people throw away receipts and forget these costs. I have seen sellers lose $10,000 to $50,000 because they did not track their upgrades," Akin says.

Deduct selling costs

You can also subtract some of the expenses associated with selling your home from your realized gain, such as agent commissions, closing costs, transfer taxes, and advertising fees.[5] These deductions differ from itemized deductions on your income taxes because they’re subtracted directly from your capital gain.

Say you sell for $630,000 and pay $25,000 in commissions and other selling costs. Your amount realized for tax purposes is $605,000. (The average total real estate commission is 5.46%, according to Clever's latest agent survey.)

Like raising your basis, lowering your amount realized moves your gain closer to, or under, the exclusion limit. To estimate your costs up front, see our guide to how much it costs to sell a house.

Offset the gain with investment losses

If part of your home-sale gain is taxable, capital losses from selling other investments, like stocks, can offset it. If you have losing positions you were planning to sell anyway, selling them in the same year as your home sale can reduce your tax bill (tax-loss harvesting).

One limit: if you sell your own home at a loss, that loss isn't deductible.

Time your sale to a lower-income year

Your long-term capital gains rate depends on your total taxable income for the year, including the gain itself. If you expect your income to drop, for example because you're retiring, changing jobs, or taking a sabbatical, waiting to sell could put more of your gain in a lower bracket.

In 2026, long-term gains are taxed at 0% as long as your total taxable income, including the gain, stays at or below $49,450 (single) or $98,900 (married filing jointly). Above that, the rate is 15%, and it rises to 20% over $545,500 (single) or $613,700 (married filing jointly).

"The most common mistake I see is bad timing. Many people sell during a year when their income is already high. That pushes them into a higher tax rate," says Kevin Marshall, a CPA and personal finance professional at Amortization Calculator.

On a $100,000 taxable gain, the difference between the 0% rate and the 15% rate is $15,000. The math gets complicated fast, so talk to a CPA 6 to 12 months before you list.

1031 exchange (for investment or rental properties)

A 1031 exchange only applies to investment and rental properties, not to primary residences. It lets you defer your capital gains taxes by rolling the profits of one property directly into a similar type of real estate investment.[6] In fact, you can defer taxes indefinitely and use successive exchanges to build wealth and your portfolio.

However, rules around 1031 exchanges are complicated and must be strictly followed. You have just 45 days after closing to identify a replacement property and just 180 days to complete the purchase. You also can’t hold onto the money yourself in the meantime either. Instead, a qualified intermediary holds the funds on your behalf.

The takeaway is that while a 1031 exchange is a powerful avenue to building wealth and lowering your tax liability, it’s one that you need to discuss with your tax advisor beforehand.

The 3.8% net investment income tax (NIIT): Who it hits

For high earners, the net investment income tax (NIIT) is an often-overlooked aspect of your tax obligations when selling a house. The NIIT is a 3.8% surtax applied on top of your regular capital gains rate if your adjusted gross income is above $200,000 (for single filers) or $250,000 (for married joint filers).

The NIIT applies to any capital gains that exceed the primary residence threshold (as a reminder, that’s $250,000 for single filers and $500,000 for married joint filers). If NIIT applies to you, your capital gains tax rate will be either 18.8% (15% + 3.8%) or 23.8% (20% + 3.8%) depending on your specific income level.

If you’re near these income thresholds, you’ll need to factor in the NIIT or potentially time your home sale during a year when you anticipate having a lower income.

Special situations: Rules that apply to you

Divorce, inheritance, and a few other situations involve tax rules that most sellers never use. If you don't know about them, you could end up paying more than you need to.

"Sellers who inherit their home, are selling due to a divorce or widowhood, or are relocating for military service, may be eligible for significant savings if they are aware of the tax rules governing these situations. These individuals may not realize they are entitled to greater tax savings, so they end up paying more than necessary," Marshall says.

Converted rentals and home offices

If you rented out your home or claimed a home office deduction, two rules can cut into your exclusion.

Depreciation recapture is the first. Any depreciation you claimed, or were entitled to claim, after May 6, 1997, is taxed when you sell, at up to 25%. The exclusion can't cover it. Skipping depreciation on your returns doesn't help, because the IRS taxes depreciation you were allowed to deduct anyway.

Nonqualified use is the second. If you rented the home first and moved in later, rental years after 2008 count as "nonqualified use," and that share of your gain is taxable. Say you owned a home for 10 years, rented it for the first eight, and lived in it for the last two. Then 80% of your gain is taxable, even after you pass the two-year tests.

The reverse order works better. If you lived in the home first and then rented it out, the rental time after you move out doesn't count as non-qualified use. You can still claim the full exclusion if you sell within about three years of moving out.

Phillip Zagotti, a tax attorney, CPA, and founder of North Star Law Firm in Houston, says the exclusion "isn't permanent and dates matter. It is a tax benefit that must be exercised by an expiration date."

One more limit: if you got the home through a 1031 exchange, you have to own it for at least five years before you can use the exclusion..

For more on rental sales, see our guides to capital gains tax on investment property and how to avoid taxes when you sell a rental property.

Inherited property

Inherited homes benefit from what’s called a stepped-up basis, which means that the cost basis is reset to the fair market value on the date of the original owner’s death.[7] That’s great for your tax bill, since calculating the stepped-up basis from the original purchase date (which may have been decades ago) may otherwise lead to an extremely large capital gain.

Say your parents bought a house in 1980 for $80,000, and it was worth $400,000 when they died. If you inherit it and sell right away for $410,000, your taxable gain is $10,000, not $330,000. See our guide to selling an inherited home for the full process.

Divorce

Following a divorce, you can transfer the house from one ex-spouse to another with the receiving spouse inheriting the original cost basis rather than the current market value. Also, even if one spouse has moved out, both spouses may be able to claim the primary residence exclusion on their share of the capital gain so long as they both meet the use test.

However, whether you sell before or after the divorce will affect how the exclusion applies. Because the exclusion doubles for married couples, you may want to delay your divorce.

As Dr. Randy E. Beavers, Associate Professor of Finance at the University of North Alabama, says, “I would also recommend couples not to finalize the divorce (if possible) until the year after the home sale is final to ensure an additional penalty is not incurred, since married couples can be exempt for double the amount versus single owners.”

Divorce changes many of the normal rules around buying and selling real estate, so you should consult with a tax advisor as early in the process as possible.

Want to see how calculating your divorce house buyout would work in your specific situation? Use our divorce buyout calculator.

Recent widowhood

If your spouse passed away and you haven’t remarried, you may still be able to qualify for the full $500,000 exclusion. You’ll need to use the exclusion within two years of your spouse’s death and meet other qualifying tests, such as not taking the exclusion within the past two years.[5]

After that two-year window passes, you’ll be considered a single filer and your exclusion will drop to $250,000. You should talk with your CPA to evaluate whether selling before that two-year deadline makes sense for you.

Military and federal service

The standard 2-in-5-year rule for the primary residence reduction is extended to 10 years for active-duty military members, Foreign Service officers, and some intelligence personnel.[5] You’ll need to be stationed at least 50 miles from your main home in order to qualify.

This exception ensures military members don’t lose out on the primary residence exclusion due to deployment. In many cases, the 10-year rule also extends to spouses.

Partial exclusion when you don't fully qualify

If you don’t meet the 2-in-5-year rule for the primary residence exclusion, you may be able to apply for a partial exclusion. A partial exclusion is available to you if you had to sell your home before two years because of a job change, health issue, or other unforeseen circumstance (such as your house being condemned, or giving birth to two or more children at the same time).[5]

The exclusion is prorated based on how long you lived in the house as compared to the two-year requirement. So, if you live in the house for 12 months, you could qualify for up to 50% of the normal exclusion.

Partial exclusions aren’t widely known and often underutilized. You should talk to a CPA if you don’t meet the two-year rule but need to sell soon.

State taxes

Most states with an income tax also tax home-sale gains, usually as ordinary income. Nine states have no broad income tax: Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming. Washington taxes some capital gains but exempts real estate. See our ultimate guide to real estate taxes for state-by-state rules.

When to talk to a CPA (not just an agent)

You should talk to a CPA as soon as possible, ideally at least 6-12 months before you list. If you only consult a CPA after you close, you’ll have far fewer options.

As Akin says, “If someone comes to me six months before selling, I review all their records and check for missing improvements. Planning early almost always saves money. The biggest lesson is simple: keep your receipts and plan before you sell.”

A CPA is especially useful if any of the following applies to you:

  • Your capital gains will likely exceed the primary exclusion threshold ($250,000 for single filers/$500,000 for joint married filers)
  • You’re selling a rental or investment property
  • You’re in a special situation as described above (inheritance, widowhood, divorce, or military)
  • Your income is near or exceeds the NIIT threshold ($200,000 for single filers/$250,000 for married)
  • You recently converted your primary residence to a rental property (or vice versa)

You should have both a CPA and a real estate agent on your team when selling a house, as they both play very different roles. A CPA can help maximize the amount of your sale proceeds you actually get to keep, while a good agent can help you get the best price possible.

Once you’ve found a CPA, focus on teaming up with a qualified real estate agent. Clever can connect you with top local realtors at reduced commission rates, keeping more money in your pocket.

FAQ

Do I have to report the sale of my home if I don't owe any capital gains tax?

Not always, but there are exceptions. If you receive a Form 1099-S from the title company, you must report the sale on your return even if your gain is fully excluded. If you exclude 100% of the gain and didn't receive a 1099-S, you typically don't need to report it. When in doubt, report it — a CPA can confirm.

What if I've only lived in the house for one year — do I still owe capital gains tax?

Likely yes, unless you qualify for a partial exclusion due to a job change, health issue, or unforeseen event. If you've owned it for less than a year, you'll also face short-term capital gains rates (same as ordinary income, up to 37%) rather than the lower long-term rates. Planning the timing of your sale carefully can save you significantly.

Do I owe capital gains tax if I'm selling to buy another house?

Not automatically. There's no "rollover" provision that lets you defer taxes by buying a replacement primary residence (that rule was eliminated in 1997). Your tax liability is based purely on the gain from the sale and whether you meet the exclusion tests. The only deferral option is a 1031 exchange, and that applies to investment properties only, not your primary home.

What counts as a home improvement for cost basis purposes?

Capital improvements that add value or extend the home's life: additions, new roof, HVAC, kitchen or bathroom remodels, new windows, finished basement. Regular maintenance and repairs do not count; patching a roof, painting, or fixing appliances won't increase your basis. Keep receipts and permits; the IRS may ask for documentation. When in doubt, ask your CPA what qualifies.

Can I avoid capital gains tax by gifting the house instead of selling it?

Gifting doesn't eliminate the tax; it transfers the tax burden. The recipient takes your cost basis, so when they eventually sell, they may owe capital gains on the full appreciation since your original purchase. If the home is likely to be inherited instead, the stepped-up basis at death can be significantly more tax-efficient. Consult an estate attorney before deciding.

Related reading

Article Sources

[1] IRS – "Topic no. 409, Capital gains and losses". Accessed October 8, 2026.
[2] IRS – "Rev. Proc. 2025-32". Accessed October 8, 2026.
[3] IRS – "Find out if net investment income tax applies to you". Accessed October 8, 2026.
[4] IRS – "Topic no. 701, Sale of your home". Accessed October 8, 2026.
[5] IRS – "Publication 523 (2025), Selling Your Home". Updated N/A. Accessed Mar 24, 2026.
[6] IRS – "Publication 544 (2025), Sales and Other Dispositions of Assets". Updated N/A. Accessed Mar 24, 2026.
[7] IRS – "Publication 551 (12/2025), Basis of Assets". Updated N/A. Accessed Mar 24, 2026.

Better real estate agents at a better rate

Enter your zip code to see if Clever has a partner agent in your area
If you don't love your Clever partner agent, you can request to meet with another, or shake hands and go a different direction. We offer this because we're confident you're going to love working with a Clever Partner Agent.