How to Avoid Capital Gains Tax When Selling a House

Michael Warford's Photo
By Michael Warford Updated August 2, 2024
+ 1 more
's Photo
Edited by Cara Haynes

SHARE

When selling a house for a profit, you might be subject to at least some capital gains tax. The exact amount will depend on factors like whether you lived in the home or used it as a rental, your income and filing status (single vs. married), and how long you’ve owned the property.

Fortunately, there are ways you can reduce the amount you owe in capital gains tax — and possibly even avoid it altogether. Here's what you need to know about capital gains on a home sale.

How to avoid capital gains tax on your home sale

You can usually avoid paying most or all of the capital gains tax if you’re selling your primary residence and you haven’t used the capital gains tax exemption in the past two years. Just make sure that you meet all the requirements for what the IRS considers a primary residence.

But if you’re selling a second home or investment property, there’s a higher chance the capital gains tax will apply to you. That said, there are still ways you can reduce your capital gains tax bill or avoid it all together. Here’s how.

Sell your home with a top Clever agent, save thousands on commission.

Clever vets agents based on performance from Berkshire Hathaway, Keller Williams, and hundreds of top brokerages and negotiates lower insider rates on your behalf. When you work with Clever, you can sell for just 1.5%—roughly half the traditional fee.

Live in a house for at least two years

Most capital gains exclusions are reserved for those selling their primary residence and not for second homes or investment properties. However, you may be able to convert your second home or investment property into a primary residence that's eligible for a capital gains exclusion. You'll be eligible if you’ve owned it for at least two years and lived in it for at least two out of the last five years from the date you're selling it.

Reinvest using a 1031 exchange

A 1031 exchange allows you to exchange an investment or business property for another property of equal or greater value. Doing so allows you to defer any capital gains tax to the replacement property. A 1031 exchange also lets you defer any depreciation recapture tax.

Since a 1031 exchange is a tax deferral and not an exemption, you’ll still have to pay capital gains and depreciation recapture taxes if you do eventually sell the replacement property.

Spread out gains with seller financing

Similarly, seller financing can defer capital gains tax. With seller financing, the buyer makes payments directly to the seller instead of getting a mortgage from a traditional financial lender like a bank. Essentially, the seller takes on the role of the mortgage provider.

This arrangement allows the seller to defer paying capital gains tax until the property is actually sold. Keep in mind that while seller financing offers benefits, there are also risks for both the buyer and seller.

Read: Seller Financing: A Guide for Home Sellers

Sell an inherited property right away

If you’ve inherited a property, the IRS will apply a stepped-up cost basis to the value of the home, which essentially resets its value to when you inherited it, not when it was purchased. Travis Christiansen, an estate planning attorney with Boyack Christiansen Legal Solutions, explains, “So if your mom bought an asset for $20,000 and she died and you inherit it and it's worth $100,000, your basis for capital gains tax is going to be $100,000, not the $20,000.”

This difference is important since it means that if you sell the inherited property quickly, there’ll likely be no (or very little) appreciation in its value. Since you’ll have made very little capital gains from the sale (if any), you likely won’t have to pay much in capital gains tax.

Deduct home improvements and other expenses

Home improvements and expenses associated with selling a property, such as realtor commission and closing fees, can be used to deduct your total capital gains amount. For example, if you invested $20,000 in home improvements and paid $30,000 in closing costs and realtor commission, you can deduct that $50,000 from whatever profit you make on your real estate sale. As a result, your total capital gains will be smaller and you’ll pay less in taxes.

Offset gains with losses

If you’ve made a capital loss on another asset, such as on stocks that have underperformed, you can deduct that loss to offset the gains you made on the sale of a property. Those losses help lower the capital gains on your property sale, resulting in a lower overall tax bill. You’re limited to a $3,000 deduction (or $1,500 if married and filing separately) per year, although that amount can be carried over if net losses exceed the deduction limit.

What is capital gains tax?

Capital gains tax is the tax you pay on whatever profits you make when you sell an asset, such as a house. The specific capital gains tax rate depends on the amount of profit you make, the type of asset, your taxable income and filing status, and how long you held the asset for.

Short-term capital gains taxes apply to assets that are held for a year or less, whereas long-term capital gains are for assets held for more than a year. Short-term capital gains tax rates are usually the same as your income tax rate. The long-term rate ranges from 0%, or 20%, although most people pay 15%.

How much is capital gains tax on a home sale?

The capital gains tax rate for home sales varies based on numerous factors and applies only to the profit you make on the sale, not the entire sale price. For example, if you bought a house for $300,000 and then resold it for $350,000, you’d pay capital gains tax on just the $50,000 difference.

The factors that will affect your capital gains tax rate are the following:

  • How long you held the asset for: You’ll usually pay a higher tax rate if you hold an asset for less than a year.
  • How you used the house: The tax you pay differs depending on whether you’re selling a primary residence, investment property, or second home.
  • Your filing status: Married people filing jointly and some widowed filers can apply for a higher exemption than single filers and married couples who file separately.
  • Your taxable income: Short-term capital gains are taxed based on your income, although long-term assets aren’t.
  • How recently you sold another property: If you sold a house less than two years ago and used the capital gains tax exclusion, you’ll pay more in capital gains tax this time.
  • Whether you’ve sold other assets: If you’ve sold other taxable assets and made a net loss, that loss will offset the total capital gains you have to pay tax for your home.

2024 capital gains tax brackets

In general, if you’ve held onto a property for a year or less, you’ll pay the short-term rate. If you’ve held onto it for more than a year, you’ll pay the long-term rate.

Short-term capital gains tax brackets

The short-term capital gains tax rate is generally the same as your income tax rate. The taxes you pay are dependent on your income bracket and your filing status.

Tax rate Single Married, filing jointly Married, filing separately Head of household
10% $0 to $11,600 $0 to $23,200 $0 to $11,600 $0 to $16,550
12% $11,601 to $47,150 $23,201 to $94,300 $11,601 to $47,150 $16,551 to $63,100
22% $47,151 to $100,525 $94,301 to $201,050 $47,151 to $100,525 $63,101 to $100,500
24% $100,526 to $191,950 $201,051 to $383,900 $100,526 to $191,950 $100,501 to $191,950
32% $191,951 to $243,725 $383,901 to $487,450 $191,951 to $243,725 $191,951 to $243,700
35% $243,726 to $609,350 $487,451 to $731,200 $243,726 to $365,600 $243,701 to $609,350
37% $609,351 and up $731,201 and up $365,601 and up $609,351 and up
Show more

Long-term capital gains tax brackets

The long-term rate is either 0%, 15%, or 20%, although the majority of people end up paying 15%. The taxes you pay are dependent on your income bracket and your filing status.

Tax Rate Single Married, filing jointly Married, filing separately Head of household
0% $0-$47,025 $0-$94,050 $0-$47,025 $0-$63,000
15% $47,025-$518,900 $94,050-$583,750 $47,025-$291,850 $63,000-$551,350
20% $518,900+ $583,750+ $291,850+ $551,350+
Show more

Capital gains tax on a primary residence

Selling a primary residence often results in a lower capital gains tax bill than selling a second home or investment property. The IRS allows you to exclude some or even all of the capital gains you make on the sale of your primary home, depending on the following factors:

  • How long you owned the home
  • How long you’ve lived in the home
  • How much profit you made on the sale
  • Your income tax bracket
  • Your filing status

For example, single filers can get an exemption of up to $250,000, while married joint filers can exclude $500,000 from their otherwise taxable capital gains. If you’re married and selling a property that you bought five years ago for $300,000 that sells for $500,000, your profit will be $200,000. Thanks to your $500,000 exemption on your primary residence, you won’t have to pay any capital gains tax.

In the next section, we’ll go into more detail about other ways to qualify for a capital gains tax exemption on your primary residence.

Do you qualify for a capital gains exemption on your primary residence?

Aside from your filing status, there are many other ways you can get a full or partial exemption from the capital gains tax when you sell your home. However, there are other conditions you’ll need to meet in order to qualify for these exemptions.

  1. The home is your primary residence.
    Simply owning the property or even furnishing it with your own possessions doesn’t necessarily make it your primary residence for tax purposes. Instead, you’ll have to meet ownership and occupancy requirements (which we’ll look at in more detail below). You can only have one primary residence at a time, although in some cases you may be able to convert a second home into your primary residence.
  2. You've owned the home for at least two years.
    You’ll need to have owned your property for at least two years. So long as the home has a sleeping area, bathroom, and kitchen, then mobile homes, apartments, and boathouses may also qualify as primary residences.
  3. You've lived in the home for at least two of the last five years.
    You must have lived in your primary residence for two out of the last five years, which can be shown through utility bills, tax returns, driver’s license, or voter registration. For divorcing spouses, the one who gains ownership of the house can include the years when the house was owned by the former spouse toward satisfying the occupancy requirement. Military personnel and some government officials on official extended duty can defer the five-year requirement by 10 years. In effect, this means that the occupancy requirement is two years out of 15.
  4. You didn't buy the home through a 1031 exchange.
    You can’t use the capital gains tax exemption if you bought the property through a 1031 exchange. This is a tax break that lets you swap one investment or business property for another of equal or greater value while deferring capital gains tax.
  5. You haven't used the exemption on another house within the last two years.
    You can’t use the capital gains tax exemption if you’ve already used it on the sale of another home within the past two years. The two year-period begins from the date of sale of the previous home.

Capital gains tax on a second or vacation home

A second or vacation home typically doesn’t qualify for a capital gains tax exemption. While you can convert a second home to your primary residence, you’ll need to meet the residency requirements for a primary residence along with other stipulations. Remember, for tax purposes you can only have one primary residence at a time.

The capital gains taxes you owe will depend on how much profit you’ve made from the sale, how long you’ve owned the home, and other factors. For example, assume you bought a second home for $300,000 and invested $50,000 in improvements. You then sell the property six years later for $500,000 while paying $25,000 in commission and closing costs.

In this scenario, your capital gains would be your selling price ($500,000) minus the commission and closing fees ($25,000) and minus your cost basis of $350,000 (which is the original purchase price plus improvements). So, your taxable capital gains would be $125,000. Because you owned the property for more than a year, the long term rate applies, which in this case would be 15%.

Capital gains tax on an investment property

The capital gains tax on investment properties is similar to second homes, but there are some differences. As with second homes, investment properties don’t qualify for the exemptions you’re entitled to with a primary residence. But again, you can convert an investment property to a primary residence if you meet the ownership and occupancy requirements.

If you can’t convert your investment property to a primary residence, then the amount of capital gains tax you pay are largely the same as they are for a second home. If you’re a house flipper who buys and resells homes quickly, then your capital gains tax bill could be especially high.

For example, let’s say you’re selling a property that you bought for $150,000, put $50,000 worth of improvements into (bringing your cost basis to $200,000) and then resell six months later for $300,000 (along with $25,000 in commission and closing fees). You’ll pay capital gains tax on $75,000 (i.e., the selling price minus the cost basis and commission/fees). Because you held the property for less than a year, you’ll have to pay the same capital gains tax rate as whatever your income tax bracket is (which ranges from 10% to 37%).

You’ll also need to watch out for the depreciation recapture tax when you sell an investment property, which is separate from your capital gains tax. The IRS allows you to depreciate investment property in order to lower your overall tax bill. However, when you sell that property you’ll need to pay a depreciation recapture tax if your profit is more than the depreciated amount. The tax of up to 25% is applied to the overage and applies even if you didn’t claim the depreciated value previously.

FAQ on how to avoid capital gains on real estate

How long do you need to live in a house to avoid capital gains?

You need to live in a house for at least two of the past five years in order to qualify for a capital gains exemption, in addition to other requirements. Military personnel and some government officials can extend the occupancy requirement to two years out of the past 15.

Do I have to buy another house to avoid capital gains?

If you’re selling your primary residence and you haven’t used the capital gains tax exemption in the past year, you don’t need to buy another house to avoid capital gains. If you’re selling an investment property, you can swap it for another property using a 1031 exchange to defer capital gains tax.

What is the $250,000/$500,000 home sale tax exclusion?

In general, single tax filers or married couples who file separately get a $250,000 exclusion on capital gains on their primary residence, which helps eliminate much or all of the tax they’d otherwise owe. Married joint filers and some widowed homeowners are entitled to a $500,000 exclusion.

How much time do you have to buy a new house to avoid capital gains?

If you’re selling an investment property using a 1031 exchange, you have 180 days to find another income-generating property in order to defer capital gains tax. During the 180 days, the funds from the first sale are kept in escrow.

How much capital gains will I pay on an investment property?

If you hold an investment property for less than a year, your capital gains tax is based on your income tax bracket. If you hold the property for more than a year, you’ll have to pay taxes of either 0%, 15%, or 20%, depending on your income bracket. You can also defer capital gains using a 1031 exchange.

Learn more about saving money when selling your house

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.