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 (your sale price). That difference is your capital gain. The tax rate depends on how long you owned the property and your income level. For most people, real estate held longer than one year gets taxed at the long-term capital gains rate, which is lower than ordinary income tax rates.
The math is straightforward: if you bought a house for $300,000 and sold it for $400,000, your capital gain is $100,000. You do not pay tax on the full $400,000 — only on that $100,000 gain. However, you can reduce the gain by subtracting certain costs, like real estate agent commissions, closing costs, and improvements you made to the property.
Key Takeaways
- Capital gains tax applies only to the profit on a sale, not the full sale price, and you can subtract selling costs and home improvements from that profit.
- Long-term capital gains (property owned over one year) are taxed at 0%, 15%, or 20% depending on your income, while short-term gains are taxed as ordinary income at rates up to 37%.
- If you sell your primary residence, you may exclude up to $250,000 of gain ($500,000 if married filing jointly) if you meet the ownership and use tests.
- Inherited property receives a "step-up in basis," meaning the tax basis resets to the property's value on the date of death, potentially eliminating capital gains tax entirely.
- You report capital gains on Schedule D (Form 1040) and may owe estimated taxes if the gain is large.
How your basis and adjusted basis affect the tax you owe
Your basis is what you paid for the property, including the purchase price plus closing costs like title insurance, recording fees, and attorney fees. This is your starting point for calculating gain. Many people think basis is only the purchase price, but the IRS lets you include certain upfront costs.
Your adjusted basis changes over time. You add the cost of improvements — a new roof, kitchen remodel, or addition — because these add value to the property. You subtract depreciation if you rented out the property, because the IRS assumes the building loses value each year and you deducted that loss on your tax return. When you sell, you use your adjusted basis, not your original purchase price.
Example: You bought a rental house for $250,000. You added a $30,000 deck and took $40,000 in depreciation deductions over ten years. Your adjusted basis is $250,000 + $30,000 − $40,000 = $240,000. If you sell for $350,000, your gain is $350,000 − $240,000 = $110,000.
Long-term versus short-term capital gains rates
How long you owned the property determines which tax rate applies. Long-term capital gains explore when you owned the property for more than one year. Short-term capital gains explore when you owned it for one year or less. Short-term gains are taxed as ordinary income, which means rates as high as 37% for high earners. Long-term gains are taxed at 0%, 15%, or 20% depending on your total taxable income for the year.
The long-term rates are lower because Congress wants to encourage longer holding periods. A person in the 37% ordinary income bracket might pay only 20% on a long-term capital gain. For 2024, the 0% long-term rate applies to single filers with taxable income up to $47,025, the 15% rate applies up to $518,900, and anything above that is taxed at 20%. These income thresholds change each year.
If you sold a rental property after owning it for six months, any gain would be short-term and taxed at your ordinary income rate. If you owned it for two years, the same gain would be long-term and taxed at the lower capital gains rate. This difference can be thousands of dollars.
The primary residence exclusion and who qualifies
If you sell your main home, you can exclude up to $250,000 of capital gain from tax if you are single, or $500,000 if you are married filing jointly. This is one of the largest tax breaks available. To may have access to, you must have owned the home and lived in it as your primary residence for at least two of the five years before the sale.
The two years do not have to be consecutive. If you owned the home for five years but lived in it for only two of those years, you still may have access to. If you owned it for three years and lived in it for all three, you may have access to. The IRS is flexible about the timing as long as the total adds up.
You can use this exclusion only once every two years. If you sold a home and used the exclusion in 2022, you cannot use it again until 2024. If you are married, both spouses must meet the ownership and use tests to claim the full $500,000 exclusion. If only one spouse meets the tests, the limit is $250,000.
Example: You bought a house for $200,000, lived in it for three years, and sold it for $550,000. Your gain is $350,000. You exclude $250,000, so your taxable gain is $100,000. You owe tax only on that $100,000, not the full $350,000 gain.
Depreciation recapture on rental and investment properties
If you rented out the property or used it for business, you deducted depreciation on your tax returns each year. When you sell, the IRS recaptures that depreciation and taxes it at 25%, regardless of how long you owned the property. This is separate from the capital gains tax and applies even if your overall gain is small.
Depreciation recapture is mandatory — you cannot avoid it by holding the property longer. If you deducted $50,000 in depreciation over ten years and sold the property at a $100,000 gain, you would owe 25% tax on the $50,000 depreciation ($12,500) plus the long-term capital gains rate on the remaining $50,000 gain. The depreciation portion is taxed first at the higher rate.
This is why many real estate investors track their depreciation carefully. Taking the deduction lowers your taxes each year, but you will pay it back at 25% when you sell. Some investors choose not to claim depreciation to avoid this recapture, though that is rare because the annual tax savings usually outweigh the recapture cost.
The step-up in basis for inherited property
When someone dies and leaves you real estate, you receive a major tax benefit called a step-up in basis. The tax basis of the property resets to its fair market value on the date of death, not what the original owner paid for it. This can eliminate capital gains tax entirely.
Example: Your parent bought a house for $100,000 in 1990 and it was worth $500,000 when they died in 2024. Your new basis is $500,000, not $100,000. If you sell it when ready for $500,000, you have zero gain and owe no capital gains tax. If you hold it and sell for $550,000 later, your gain is only $50,000.
The step-up applies to most inherited property, including real estate, stocks, and bonds. It does not explore to inherited retirement accounts like IRAs or 401(k)s. The step-up is automatic — you do not have to do anything to claim it, but you should document the property's value on the date of death for your records.
Reporting capital gains on your tax return
You report real estate capital gains on Schedule D (Form 1040), which is the form for reporting all capital gains and losses. You list the property, the date you bought it, the date you sold it, your basis, the sale price, and the gain or loss. If you have a loss, you can use it to offset other gains or up to $3,000 of ordinary income in the current year.
If you sold your primary residence and are claiming the exclusion, you still file Schedule D but enter the exclusion amount. The form walks you through the calculation. If you have a large gain, you may owe estimated taxes in the year of the sale, which means making quarterly payments to the IRS rather than waiting until April.
Keep all documents related to the sale: the purchase agreement, closing statement, receipts for improvements, and the sale closing statement. The IRS can audit real estate transactions years later, and these documents prove your basis and the gain you reported.
Frequently Asked Questions
Do I owe capital gains tax if I sell my home at a loss?
No. If you sell your primary residence for less than you paid, you have a loss and owe no capital gains tax. You also cannot deduct the loss on your tax return — losses on personal residences are not deductible. If you sold a rental property at a loss, you can use that loss to offset other capital gains or up to $3,000 of ordinary income per year.
What if I owned the property for exactly one year — is it long-term or short-term?
Short-term. The IRS requires more than one year of ownership for long-term treatment. If you bought on January 15, 2023 and sold on January 15, 2024, it is exactly one year and taxed as short-term. You need to own it into January 16, 2024 or later for long-term treatment.
Can I deduct real estate agent commissions and closing costs from my gain?
Yes. Selling costs like real estate agent commissions, title insurance, recording fees, and attorney fees reduce your gain. You subtract them from the sale price before calculating your profit. Buying costs like inspection fees and appraisal fees are added to your basis, which also reduces your gain.
What happens to capital gains tax if I sell property in a different state?
Federal capital gains tax applies regardless of which state you sell in. Some states also tax capital gains — California, New York, and others have their own capital gains taxes. A few states like Texas and Florida have no state income tax. You owe tax to both the federal government and your state (if applicable) based on where you lived when you sold.
If I inherited property, do I have to pay capital gains tax when I eventually sell it?
Only on gains after you inherited it. Because of the step-up in basis, your starting point is the property's value on the date of death. Any increase in value after that date is a new gain. If the property was worth $500,000 when you inherited it and you sell for $550,000, your taxable gain is $50,000, not the full appreciation since the original purchase.