Capital gains tax on real estate is the tax you owe on the profit when you sell a property for more than you paid for it
When you sell a house, rental property, or land, the IRS taxes the difference between what you paid (your basis) and what you sold it for (the sale price). That difference is your capital gain. The tax rate depends on how long you owned the property and your income level. Most people pay either 0%, 15%, or 20% on long-term gains — property you held for more than one year. Short-term gains (property held one year or less) are taxed as ordinary income, which can be much higher.
Real estate is treated differently from other investments because you can exclude some or all of the gain if you lived in the home as your primary residence. If you owned and lived in the house for at least two of the last five years before selling, you can exclude up to $250,000 of the gain if you're single, or $500,000 if you're married filing jointly. This exclusion is available once every two years.
Key Takeaways
- Capital gain is the profit you make when you sell real estate — the sale price minus what you originally paid plus improvements you made.
- Long-term capital gains (property held over one year) are taxed at 0%, 15%, or 20% depending on your total income; short-term gains are taxed as ordinary income at your regular tax rate.
- If you lived in the home as your primary residence for at least two of the last five years, you can exclude up to $250,000 (single) or $500,000 (married) of the gain from tax.
- Your basis includes not only the purchase price but also the cost of major improvements like a new roof or addition, which reduces your taxable gain.
- Inherited property receives a "step-up in basis," meaning your starting point for calculating gain is the property's value on the date of death, not what the original owner paid.
How your basis and improvements affect what you owe
Your basis is the starting number for calculating gain. It is usually the price you paid for the property, including closing costs like title insurance and attorney fees. If you inherited the property, your basis is its fair market value on the date the previous owner died — not what they originally paid. This is called a step-up in basis and can significantly reduce or eliminate capital gains tax on inherited real estate.
You can increase your basis by adding the cost of capital improvements — major upgrades that add value or extend the life of the property. A new roof, addition, new HVAC system, or kitchen renovation counts. Repairs and maintenance do not count, even if they are expensive. The difference matters: if you spent $50,000 on a new roof and $5,000 on annual maintenance, only the roof cost increases your basis.
When you sell, subtract your basis (plus improvements) from the sale price. The result is your capital gain. If you sell for $400,000 and your basis is $250,000, your gain is $150,000. If you lived there as your primary home for two of the last five years, you subtract the $250,000 exclusion, leaving $0 taxable gain.
Long-term versus short-term capital gains rates
The tax rate on your gain depends on how long you owned the property. Long-term capital gains apply to property you held for more than one year. These rates are lower than ordinary income tax rates and are based on your total taxable income for the year:
- 0% rate applies if your income falls below a certain threshold (in 2024, roughly $47,000 for single filers, $94,000 for married filing jointly).
- 15% rate applies to most middle-income taxpayers.
- 20% rate applies to high-income taxpayers (in 2024, single filers with income over roughly $518,000, married filers over $583,000).
Short-term capital gains apply to property you held for one year or less. These are taxed as ordinary income at your regular tax bracket, which can range from 10% to 37% depending on your income. Short-term gains are rarely used for real estate because most people hold property longer, but it matters if you buy and sell quickly or inherit property and sell it within a year.
These income thresholds and rates change each year. The IRS publishes updated numbers annually, so check the current year's rates when you are planning a sale.
The primary residence exclusion and how to use it
If you owned and lived in the home as your main home for at least two of the five years before you sold it, you can exclude capital gains from tax. The exclusion is $250,000 for single filers and $500,000 for married couples filing jointly. This is one of the largest tax breaks available to homeowners and can eliminate tax on most residential sales.
The two years do not have to be consecutive, and they do not have to be the two years immediately before the sale. If you lived in the house for two years, moved out, rented it for three years, and then sold it, you still may have access to — as long as the sale happened within five years of when you moved out. However, if you rent out the property after you move, the exclusion shrinks by the percentage of time you rented it. If you lived there four years and rented it two years, you lose one-third of the exclusion.
You can use this exclusion once every two years. If you sold a home and used the exclusion in 2022, you cannot use it again until 2024. This rule prevents people from buying, living in, and selling multiple homes in quick succession to avoid all capital gains tax.
Rental properties and investment real estate
Rental properties and investment real estate do not may have access to for the primary residence exclusion. You pay capital gains tax on the full profit, minus your basis and improvements. However, you can deduct depreciation you claimed on the property over the years you owned it — but there is a catch: you must pay back that depreciation at a 25% tax rate when you sell, even if your long-term capital gains rate would be lower.
For example, if you claimed $100,000 in depreciation on a rental property over ten years, you owe 25% tax on that $100,000 ($25,000) when you sell, regardless of your income level. The remaining gain is taxed at your long-term capital gains rate (0%, 15%, or 20%). This recapture tax applies only to real property, not to personal property like vehicles or equipment.
Some investors use a 1031 exchange to defer capital gains tax on rental property sales. This allows you to sell one property and reinvest the proceeds in another property of equal or greater value without paying tax on the gain — but the rules are strict, and you must identify and close on the new property within specific timeframes. A tax professional can explain whether this strategy makes sense for your situation.
State and local taxes on capital gains
Federal capital gains tax is only part of what you owe. Most states also tax capital gains, and the rates vary widely. Some states tax capital gains as ordinary income (meaning rates can go up to 10% or higher), while others have separate capital gains rates. A few states have no income tax at all.
California, for example, taxes capital gains as ordinary income at rates up to 13.3%. New York taxes them at rates up to 10.9%. Washington state has no income tax but recently enacted a capital gains tax of 7% on long-term gains over $250,000. Some cities also impose local taxes on real estate sales or gains.
When you calculate what you owe on a home sale, add state and local taxes to the federal amount. A $100,000 gain might result in $15,000 in federal tax (15% rate) plus $5,000 to $10,000 in state tax, depending on where you live. Check your state's tax department website or speak with a tax professional to understand your state's rules.
What happens when you inherit real estate
Inherited property receives a step-up in basis, which is one of the largest tax benefits in the code. Instead of your basis being what the previous owner paid, it becomes the property's fair market value on the date they died. If your parent bought a house for $100,000 and it was worth $400,000 when they died, your basis is $400,000. If you sell it immediately for $400,000, you owe no capital gains tax.
This step-up applies whether you inherit a primary home, rental property, or vacant land. It applies to all heirs, not just spouses. The step-up is automatic — you do not have to do anything to claim it, but you should keep documentation of the property's value on the date of death. An appraisal or the estate tax return (if one was filed) can serve as proof.
The step-up is available only at death. If someone gives you property while they are alive, you inherit their original basis, not the current value. This is why some people choose to hold appreciated property until death rather than gift it — the heirs will owe less tax.
Frequently Asked Questions
Do I owe capital gains tax if I sell my home at a loss?
No. If you sell for less than your basis, you have a capital loss, not a gain. You cannot deduct a loss on the sale of a primary residence. However, if you sell rental property or investment real estate at a loss, you can use that loss to offset other capital gains or, in some cases, ordinary income. Consult a tax professional about how to report losses on your tax return.
What if I owned the home with someone else?
If you are married and file jointly, you can exclude up to $500,000 of gain. If you are unmarried co-owners, each of you can exclude up to $250,000 if you each lived in the home for two of the last five years. If only one owner lived there, only that owner gets the exclusion. The ownership structure (joint tenancy, tenancy in common, etc.) does not change the tax treatment, but it does affect how the gain is split between owners.
Can I deduct real estate agent commissions or closing costs from my gain?
Yes. Selling expenses like real estate agent commissions, title insurance, attorney fees, and recording fees reduce your sale proceeds and therefore reduce your taxable gain. Keep receipts for all selling costs. These are different from improvements — they do not increase your basis, but they do lower the amount you actually receive and thus lower your gain.
What if I used part of my home as a home office or rental?
If you deducted home office expenses or rented out part of the home, that portion loses the primary residence exclusion. If you used 20% of the home as a rental, you can exclude gains only on the 80% that was your primary residence. The 20% is taxed as investment property gain. You will also owe depreciation recapture tax on the rental portion.
Do I have to report the sale to the IRS even if I do not owe tax?
Yes. You must report the sale on Form 8949 and Schedule D, even if the primary residence exclusion eliminates all your tax. The IRS uses this information to track real estate transactions. Failure to report can result in penalties. Your title company or real estate agent can provide the information you need to complete the forms, or a tax professional can file them for you.