You've spent years building equity in your home, and now you're thinking about selling. But how much of that profit will you actually get to keep?
Capital gains tax on real estate can take a surprising bite out of your proceeds if you're not prepared. Fortunately, the tax code includes several ways to reduce or even eliminate the tax bite, but you have to know the rules to take advantage.
Knowing what to expect can help you plan ahead and avoid surprises at tax time. Here's what you need to know to calculate capital gains tax on real estate—and how to keep more of your home’s profit in your pocket.
How does capital gains tax on property sales work?
When you sell something for more than you paid for it, the profit is generally considered a capital gain, and it may be subject to
This applies to a wide range of assets. Think stocks, bonds, mutual funds, real estate, and even certain types of jewelry and collectibles. How much tax you'll owe depends largely on how long you owned the asset before selling it.
- Long-term capital gains: If you owned the property for more than a year before selling, your profit is considered a long-term capital gain and is usually taxed at 0%, 15% or 20%, depending on your overall taxable income.
- Short-term capital gains: If you've owned the property a year or less, you're taxed at your
ordinary income rate , which ranges from 10% to 37%.
Real estate follows these same basic rules, but there are important exceptions. For example, profits from the sale of a primary residence may qualify for special tax exclusions if you meet certain ownership and residency requirements.
2025 and 2026 long-term capital gains tax rates
Long-term capital gains generally apply to assets held for more than one year before they're sold. The tax rate you'll pay depends on your taxable income and filing status.
| Tax Year | Rate | Single Filers (Taxable Income) | Married Filing Jointly (Taxable Income) |
| 2025 | 0% | Up to $48,350 | Up to $96,700 |
| 15% | $48,351 – $533,400 | $96,701 – $600,050 | |
| 20% | Over $533,400 | Over $600,050 | |
| 2026 | 0% | Up to $49,450 | Up to $98,900 |
| 15% | $49,451 – $545,500 | $98,901 – $613,700 | |
| 20% | Over $545,500 | Over $613,700 |
Source: IRS inflation-adjusted tax thresholds for 2025 and 2026.
A note for higher-income taxpayers
If your modified adjusted gross income exceeds $200,000 ($250,000 for married couples filing jointly), you also may owe the 3.8% net investment income tax (NIIT) on your capital gains. This additional tax can increase the top federal tax rate on long-term capital gains from 20% to 23.8%.
What is the home sale tax exemption?
If you meet certain requirements, the home sale tax exclusion lets you exclude some or all of the profit from selling your primary residence from capital gains tax.
Here's how much you may be able to exclude:
- Single filer: Up to $250,000 of gain
- Married filing jointly: Up to $500,000 of gain
What was the over-55 home sale exemption?
You may recall the previous "over-55 home sale exemption," which allowed people over 55 to exclude up to $125,000 of gain on the sale of a home. That rule was replaced in 1997 by the current, more flexible home sale exclusion.
Age is no longer a factor, and homeowners can use the exclusion multiple times, provided they meet eligibility requirements.
Who's eligible for the home sale tax exemption?
To qualify for the exemption, you must pass two tests, also known as the 2-in-5-year rule.
- Ownership test: You must have owned the home for at least two years of the five years before the sale.
- Use test: You must have used the home as your primary residence for at least two of those five years.
Let's say you bought a home in 2018, lived in it until 2022 and then rented it out before selling it in 2024. You would meet both tests because you lived in it for at least two of the five years prior to the sale.
If you're married and file income taxes jointly, only one spouse must meet the ownership test to be eligible for the exemption, but both must meet the use test to claim the full $500,000 exclusion.
You generally can't claim the exemption if you've used it on another home sale in the last two years.
How do you calculate tax on a home sale profit?
Here are the steps for calculating the capital gains tax on your home sale:
- Determine your cost basis. Start with the price you paid for the home, then add the cost of any significant improvements, like a new roof or kitchen remodel. Subtract any depreciation you claimed on the property if you had a home office or used the property as a rental. The result is your adjusted cost basis.
- Subtract your selling expenses. Real estate commissions, legal fees and closing costs reduce your gain.
- Calculate your gain. Subtract your adjusted cost basis and selling expenses from the sale price.
The formula for this calculation looks like this:
Selling price (original price paid + cost of major improvements - depreciation) - selling expenses = gain
Once you know your total gain, you can determine eligibility and apply the home sale exemption (up to $250,000 as a single filer or $500,000 if married filing jointly).
Let's say you're single, and you bought your home for $300,000, spent $50,000 on improvements and sold it for $600,000 with $40,000 in selling costs. You owned the house for seven years and used it as your primary residence the whole time. You never claimed depreciation on the property.
Your adjusted basis is $350,000 (the original $300,000 purchase price, plus the $50,000 in improvements). Your gain would be:
$600,000 - $350,000 - $40,000 = $210,000 gain
Since you're under the $250,000 limit, you won't owe any capital gains taxes on the sale.
Now, assume the same facts, but that you've sold your home for $750,000. Your gain would be:
$750,000 - $350,000 - $40,000 = $360,000 gain
Because you're single, you can exclude only $250,000 of that gain, leaving $110,000 taxable as long-term capital gains.
Can you still qualify if you didn't live there for the full two years?
In some situations, you may qualify for a partial exclusion even if you don't meet the full two-year ownership and use requirements.
You may qualify for a reduced exclusion if you sold your home because of certain life events, including:
- A work-related move
- A health-related need
- Certain unforeseen events, such as changes in employment, divorce or other qualifying hardships
The amount you're allowed to exclude is generally based on how much of the two-year ownership and use requirement you completed before the sale.
For example, if you're a single filer who lived in the home for one year before relocating for a qualifying job opportunity, you may be eligible to exclude up to half of the standard $250,000 exclusion amount.
Because eligibility depends on your specific situation, it's a good idea to consult a tax professional before assuming you don't qualify.
How are investment properties and second homes taxed?
Unlike primary residences,
However, there's an additional factor to consider: depreciation recapture. If you claimed depreciation deductions over the years (common with rental properties), the IRS requires you to "recapture" that benefit when you sell. Depreciation recapture is taxed at a maximum 25% rate, potentially increasing your total tax bill.
For example, let's say you purchased a rental home for $400,000 more than a year ago, claimed $100,000 in depreciation over the years and sold it for $600,000. Your adjusted basis is $300,000. That's the $400,000 original purchase price, minus $100,000 in depreciation. So your gain would be:
$600,000 - $300,000 = $300,000 gain
Because of the depreciation recapture rules, $100,000 of that gain is taxed at 25%, and the lower long-term capital gains tax rate applies to the remaining $200,000 of gain.
How can you reduce capital gains tax on a real estate sale?
While capital gains taxes can reduce the profit you keep from a real estate sale, several strategies may help lower or defer what you owe. The right approach depends on your financial goals, the type of property you're selling and your overall tax situation.
Consider a like-kind exchange
If you're selling an investment property and plan to reinvest in another, a like-kind exchange, often called a
For example, an investor who sells a rental property may use the proceeds to purchase another income-producing property rather than recognizing the gain immediately. Deferring taxes can preserve additional capital for future investments and portfolio growth.
It's important to plan ahead, however, because 1031 exchanges are subject to strict IRS deadlines. Generally, you must identify potential replacement properties within 45 days of selling the original property and complete the purchase of the replacement property within 180 days. Missing either deadline can cause the transaction to lose its tax-deferred status.
Since the rules governing like-kind exchanges can be complex, many investors work with a qualified intermediary, tax professional and financial advisor throughout the process. With careful planning, a 1031 exchange can be a valuable tool for building and preserving long-term wealth through real estate investing.
Use tax-loss harvesting to offset gains
If you have investments that have declined in value, selling them in the same year as a real estate sale may help offset some of your capital gains. This strategy, known as
For instance, if you realize a gain from selling an investment property and also sell stocks or mutual funds at a loss, those losses may help offset part of the taxable gain. While tax considerations can be important, investment decisions should still align with your long-term financial goals rather than tax savings alone.
Include charitable giving into your tax strategy
If you’re already planning to support charitable causes,
Depending on your situation, you also may qualify for a charitable income tax deduction. This approach can be especially appealing for those looking to make a lasting charitable impact while potentially improving the tax efficiency of highly appreciated assets.
Be mindful of when selling your home
For example, someone planning to retire, take a sabbatical or experience a temporary reduction in income may benefit from delaying a sale until their taxable income is lower. While taxes shouldn't be the only factor driving a decision, thoughtful timing can be an important part of a broader tax-planning strategy.
Or, instead of selling, you always can consider
Explore Qualified Opportunity Funds
Investors with significant capital gains may be able to defer taxes by reinvesting eligible gains into a Qualified Opportunity Fund (QOF). These funds invest in designated Qualified Opportunity Zones, which are communities identified for economic development and investment.
Generally, investors have 180 days from the sale of an asset to reinvest eligible gains into a Qualified Opportunity Fund. The Opportunity Zone program was extended and enhanced by the One Big Beautiful Bill Act of 2025, creating additional planning opportunities for some investors.
This strategy may be particularly attractive for sellers with large gains who want long-term tax deferral but don't have another investment property lined up for a 1031 exchange. Because Opportunity Zone investments involve unique risks and requirements, professional guidance is essential before investing.
Consider an installment sale
An installment sale allows you to receive payments from a buyer over time rather than all at once at closing. Because gains are generally recognized as payments are received, spreading income across multiple years may help manage the tax impact of a sale.
For example, instead of recognizing a large gain in a single tax year, a seller may receive payments over several years, potentially reducing the amount of gain subject to higher tax rates in any one year.
Installment sales can be useful in certain situations, but they also introduce additional considerations, including buyer credit risk and ongoing tax reporting obligations.
Think about your legacy plans
For some families, holding appreciated property and passing it to heirs may offer important tax advantages. Inherited assets generally receive a step-up in basis, meaning the property's tax basis is adjusted to its fair market value at the owner's death.
As a result, heirs may owe little or no capital gains tax on appreciation that occurred during the original owner's lifetime if the property is sold shortly after inheritance. While estate planning decisions involve much more than taxes alone, understanding how inherited property is treated can help inform conversations about preserving wealth for future generations.
Whatever tax strategies you cultivate, they require careful consideration and timing, so be sure to discuss them with a trusted financial advisor.
What special capital gains tax situations should you know about?
Some life events and property types can bring special capital gains considerations. Here are a few situations that might affect how much tax you owe:
- Widowed homeowners. If your
spouse passed away recently, you may qualify for the full $500,000 home sale exemption if you sell within two years of their death and haven't remarried. - Military personnel. Active-duty military members and certain federal employees can suspend the 2-in-5-year rule for up to 10 years if stationed at least 50 miles from their main home and living in government housing.
- Divorced homeowners. After a
divorce , each former spouse can claim the exemption on their share of the property gain as long as they meet the ownership and use tests. Planning can preserve eligibility even if one spouse moves out before the sale. - Vacation homeowners. If you sell a vacation home that you only use personally, it is treated as a capital asset, and any profit from the sale is subject to capital gains tax. If, however, you've used it as a rental for more than 14 days per year, the IRS considers it a rental property, which means you have to report rental income. In this case, depreciation deductions could reduce your taxable income while you own it, but it also is subject to depreciation recapture.
Protect your profits and plan ahead
Dealing with capital gains taxes on real estate and other assets isn't always straightforward. Between exemptions, depreciation recapture and special rules for different life events, it's easy to overlook seemingly minor details that could wind up costing you more than necessary. Discussing options with an experienced tax advisor before you sell helps you take advantage of available tax breaks.
A