Capital gains tax on real estate and home sales: A guide
Contributed by Karen Idelson
Updated Feb 9, 2026
•8-minute read

Selling your home may be one of the biggest financial decisions you’ll make. And it can come with tax implications as well. When you sell your home or other real estate for a profit, you may owe capital gains tax on the amount you make. This expense can have a big impact on a home seller’s bottom line at closing.
The good news is that there are strategies that can help reduce what you owe. Understanding how capital gains tax works can help you keep more of the proceeds from the sale of your house. We’ll break down the basics so you can make informed decisions that align with your financial goals.
What are capital gains taxes?
Capital gains tax is a type of tax that is charged when you profit from the sale of an asset, such as your home, investment property, stocks, bonds, precious metals, and more.
Capital gains taxes come in two forms: short-term and long-term capital gains. You’ll pay a different tax rate depending on how long you own the asset before selling it, with long-term capital gains rates typically being lower than short-term capital gains rates.
How do capital gains taxes on real estate work?
It’s very important to note that capital gains tax only applies to the profit you earn from selling an asset. In the case of real estate, that means you pay taxes on the difference between the amount you sold the home for and the amount you paid for it, also called your cost basis.
Keep in mind that if you sell your home for a loss, you don’t get to pay negative taxes and get a refund on your tax return, though you may be able to take some deductions.
For example, imagine you buy a home for $300,000, live there for a few years, then sell it for $400,000. You owe capital gains tax only on the $100,000 in profit you earned. Depending on whether you’ve put money into fixing up the home or used it as a primary residence, you may be able to reduce the amount you owe in taxes, but we’ll go into further detail on that later in the article.
Short-term vs. long-term capital gains taxes
Capital gains taxes are broken into short-term and long-term capital gains. What you pay depends on the length of time you owned the property before selling it.
If you own something for one year or less before selling, you owe short-term capital gains taxes. If you own something for a year and a day or longer, you pay long-term capital gains taxes.
Both short-term and long-term capital gains tax rates depend on your income, with long-term gain rates being lower than short-term gain rates.
Short-term capital gains tax rates for 2025
Figuring out the tax rate for short-term capital gains is relatively simple. Short-term gains are treated as ordinary income and taxed at your normal income tax rate, which can range from 10% to 37% depending on your income.
If you sell your home after less than a year of living in it, you’ll pay these rates:
|
Tax rate |
Single filer |
Married filing jointly |
Head of household |
Married filing separately |
|
10% |
$0 – $11,925 |
$0 – $23,850 |
$0 – $17,000 |
$0 – $11,925 |
|
12% |
$11,926 – $48,475 |
$23,851 – $96,950 |
$17,001 – $64,850 |
$11,926 – $48,475 |
|
22% |
$48,476 – $103,350 |
$96,951 – $206,700 |
$64,851 – $103,350 |
$48,476 – $103,350 |
|
24% |
$103,351 – $197,300 |
$206,701 – $394,600 |
$103,351 – $197,300 |
$103,351 – $197,300 |
|
32% |
$197,301 – $250,525 |
$394,601 – $501,050 |
$197,301 – $250,500 |
$197,301 – $250,525 |
|
35% |
$250,526 – $626,350 |
$501,051 – $751,600 |
$250,501 – $626,350 |
$250,526 – $375,800 |
|
37% |
$626,351 or more |
$751,601 or more |
$626,351 or more |
$375,801 or more |
Long-term capital gains tax rates for 2025
Long-term capital gains rates apply if you sell your home after owning it for a full year. Long-term capital gains rates are lower, ranging from 0% to 20%. That means you can save a lot of money in taxes by keeping your home for more than one year.
|
Tax rate |
Single filer |
Married filing jointly |
Head of household |
Married filing separately |
|
0% |
$0 – $48,350 |
$0 – $96,700 |
$0 – $64,750 |
$0 – $48,350 |
|
15% |
$48,351 – $533,400 |
$96,701 – $600,050 |
$64,751 – $566,700 |
$48,351 – $300,000 |
|
20% |
$533,401 and up |
$600,051 and up |
$566,701 and up |
$300,001 and up |
How to calculate capital gains taxes on a home sale
To calculate the capital gains taxes owed from selling your home, you need to multiply the profit you earned by the tax rate that applies. The formula is:
(Revenue from sale - Cost basis) x tax rate = tax owed
In some cases, the cost basis for your home may be higher than the amount you paid for it. This is called adjusted cost basis.
For example, if you make capital improvements to your home, meaning you add value and utility to the home beyond just doing routine maintenance and repairs, you can add those costs to the cost basis.
Imagine you bought a home for $450,000 in 2022 and sold it in 2025 for $600,000. Your profit would be: $600,000 - $450,000 = $150,000, and you’d pay long-term capital gains on that amount.
Now imagine that while you owned the property, you added an additional room to the home at a cost of $75,000. That’s a capital improvement, and you can add that cost to your cost basis, making your profit $600,000 – ($450,000 + $75,000) = $75,000. That reduces the amount you owe in tax.
What is the capital gains home sale tax exclusion?
Another way to reduce the capital gains you owe on a property is by taking advantage of the home sale tax exclusion. This is available to homeowners who are selling their primary residence for a profit.
This allows you to exclude up to $250,000 ($500,000 if married, filing jointly) in capital gains from taxes.
For example, if, as a single filer, you buy a home for $400,000 and then sell it for $700,000, the exclusion means you’d pay tax on just $700,000 - $400,000 - $250,000 = $50,000 in capital gains rather than the full profit of $300,000.
To qualify, you must meet both the ownership and use tests. These tests state that:
- You must have used the home as your main home for at least two of the past five years
- You’ve owned the home for at least two of the last five years
- You have not taken the exclusion for the sale of another home in the past two years
Some exceptions apply. For example, if you work in the military or foreign service and get assigned to a duty station far from home, you can still use this exclusion despite not living in the property.
Capital gains taxes on investment properties and second homes
If you own a property as an investment or second home, the tax rules are slightly different. For one, you are not eligible to take the home sale tax exclusion when calculating the amount of tax you owe.
For investment properties, you may have chosen to depreciate the value of your property while you rented it out. This means you wrote off a portion of the property’s value each year to reduce your tax liability.
When you sell an investment property for a profit, the IRS recaptures that depreciation because the home did not actually depreciate and instead appreciated in value. Put simply, you wind up paying taxes on some of the depreciation value, as well as the profit you earn from the sale, based on the home’s original cost basis.
Calculating how much you owe because of recaptured depreciation can be complicated, so consider working with a real estate or tax professional when selling an investment property.
How to avoid capital gains taxes on a home sale
If you’re selling your home, whether to buy another home or for any other reason, use these tips to avoid or reduce capital gains taxes.
Use the primary residence exclusion
One of the easiest ways to reduce your taxes is to use the primary residence exclusion, which you can use to exclude as much as half a million dollars in profit from tax. For many people, this will be enough to eliminate capital gains taxes entirely.
Adjust your cost basis for home improvements
As you own and live in your home, odds are good that you’ll make some improvements to it beyond just routine maintenance. Putting up a fence in the backyard, building a patio, finishing the basement, or adding a new room are all improvements to your home that may let you increase the cost basis when it comes time to calculate your profits.
Any time you make an improvement, make sure to track the costs and keep receipts and records so you can adjust your cost basis.
Own your home for at least one year
Long-term capital gains tax rates are much lower than those for short-term gains rates. If you can avoid selling until at least one year after buying your home, you’ll be able to take advantage of those lower rates.
Offset your capital gains with losses
If you have capital losses, such as from selling stocks or other investments for a loss, you can deduct those losses from your gains.
For example, imagine you sell your home for a $50,000 profit after accounting for exclusions, adjusted cost basis, and so on. You also sold a losing investment for a $20,000 loss that year. You’d owe capital gains taxes on just $30,000 because you can deduct the $20,000 loss from your $50,000 gain.
Deduct your selling costs
Selling a home can be a long process, and you usually wind up getting help from a real estate agent. You may also pay for services like advertising, home staging, legal assistance, and more.
You can deduct the cost of all of these services related to selling your home from your capital gains, reducing the tax you owe.
Do a 1031 exchange
A 1031 exchange, also called a like-kind exchange, allows you to postpone paying capital gains taxes on certain assets when you use the proceeds from the sale to buy a similar asset.
Importantly, you cannot do a 1031 exchange for a primary residence or second home. In the real estate world, it mostly applies to investment property.
To be eligible, you must meet all of these requirements:
- The property you buy must be similar enough to the one you’re selling, which is generally true for real estate
- The property must be of a similar nature and function. You can’t sell a multi-family residence and buy a vacation rental.
- You can’t keep the funds from the sale and must hold them in escrow while you buy the next property
- You must identify a replacement property within 45 days of selling the old property
- You must close on the replacement property within 180 days of selling the old property
If you meet these requirements, you pay taxes only on the money left over from the sale after buying the new property. If you put all of the proceeds from the previous property into the new one, you pay no tax.
However, keep in mind that this only defers taxes. The cost basis of the new property won’t be the amount you paid for it. Instead, it will be the amount you paid for the original property you sold for the exchange. You’ll pay the taxes in the end once you sell the new property.
This simplified example shows how a 1031 exchange works.
You buy an investment property for $350,000. You then sell it for $500,000 and follow all of the rules to complete a 1031 exchange, buying a new property for $500,000. You owe no capital gains taxes.
Later, you sell the new property for $600,000. You owe capital gains taxes on the profit you earned based on the cost basis of the original property: $600,000 - $350,000 = $250,000. Your taxes are deferred until the sale of the property you exchanged into, not simply ignored entirely.
The bottom line: Prepare to pay capital gains taxes when you sell a home
Selling your home can be an involved process. The last thing you want is to be surprised by a big tax bill at the end of the year. Make sure to prepare yourself for any taxes you might owe and take steps to limit your tax liability by adjusting your home’s cost basis, using the home sale tax exclusion, or with other strategies.
If you’re looking to upgrade to a better home, you might still need a mortgage to afford it, even after selling your old home. If you’re ready to begin the search for a new home, you can start an application with Rocket Mortgage today.
1 This article is for informational purposes only and is not intended to provide financial, investment, or tax advice. You should consult a qualified financial or tax professional before making decisions regarding your retirement funds or mortgage.

TJ Porter
TJ Porter has ten years of experience as a personal finance writer covering investing, banking, credit, and more.
TJ's interest in personal finance began as he looked for ways to stretch his own dollars through deals or reward points. In all of his writing, TJ aims to provide easy to understand and actionable content that can help readers make financial choices that work for them.
When he's not writing about finance, TJ enjoys games (of the video and board variety), cooking and reading.
Related resources

5-minute read
What is property tax and how to calculate it
Property taxes are paid to local governments to help cover the cost of community services we receive. Discover how to calculate property taxes with our guide...
Read more
5-minute read
Gift tax in real estate: How it works
The gift tax can apply when you transfer property without receiving full market value in return. Learn about gift tax in real estate and how to avoid it.
Read more

5-minute read
8 tax deductions for homeowners: Your breaks and benefits
If you own your home, you can save money when on income tax by deducting specific expenses. Get the most value from your home with these 8 tax deductions.
Read more