You pay capital gains tax when you sell real estate for more than you paid for it, and the tax is due in the year of the sale
Capital gains tax on real estate is triggered by a sale or transfer of ownership. The tax applies to the profit — the difference between what you paid for the property (your basis) and what you received when you sold it. You owe the tax in the tax year the sale closes, not when you list the property or sign a contract.
The timing matters because it determines which tax year you report the gain and which tax brackets apply. If you close in December, you report it that year. If you close in January, you report it the following year. The IRS does not tax the gain until the transaction is complete and you have received the proceeds.
Real estate transfers that happen outside of a traditional sale — such as gifts to family members, transfers into a trust, or transfers between spouses during divorce — may not trigger capital gains tax at the time of transfer, though the rules vary by situation and state. A transfer at death generally does not trigger capital gains tax for the estate, though the beneficiary's basis in the property changes.
Key Takeaways
- Capital gains tax is owed on the profit from a real estate sale in the year the sale closes, based on the difference between your purchase price and sale price.
- Long-term capital gains (property held over one year) are taxed at lower federal rates than short-term gains, which are taxed as ordinary income.
- Homeowners can exclude up to $250,000 of gain if single or $500,000 if married filing jointly, provided they meet the ownership and use tests.
- The sale price minus your basis (adjusted for improvements and depreciation) determines your taxable gain, not the total sale price.
- You report capital gains on Schedule D of your federal tax return in the year the sale closes, regardless of when you receive the full payment.
How your basis and adjusted basis affect the tax you owe
Your basis is what you paid for the property, including the purchase price, closing costs, and any debt you assumed. This is your starting point. When you sell, the IRS subtracts your basis from the sale price to calculate your gain.
Your adjusted basis changes over time. It increases when you make capital improvements — permanent upgrades like a new roof, addition, or major renovation. It decreases if you claimed depreciation deductions (common for rental properties or if you used part of your home for business). Repairs and maintenance do not increase basis; only improvements that add value or extend the life of the property do.
Example: You bought a house for $300,000. You spent $50,000 on a new roof and foundation work. Your adjusted basis is now $350,000. You sell for $500,000. Your gain is $150,000, not $200,000. Keep receipts and records of all improvements because the IRS will ask for documentation if you are audited.
Long-term versus short-term capital gains rates
The federal tax rate on your gain depends on how long you owned the property. If you owned it for more than one year, it is a long-term capital gain. Long-term rates are lower: 0%, 15%, or 20% depending on your total income for the year. If you owned it for one year or less, it is a short-term capital gain, taxed as ordinary income at rates up to 37%.
Most real estate sales may have access to for long-term treatment because people typically hold property for years. Short-term gains are rare in real estate but can happen if you buy, improve, and sell quickly — for example, a house flip held for eight months.
Your state may also tax capital gains. Some states have no capital gains tax on real estate. Others tax it as income. A few states have a separate capital gains tax. Check your state's rules because state tax can add 5% to 13% to your federal bill.
The primary residence exclusion and who qualifies
If the property was your primary residence, you may exclude part or all of your gain from federal tax. Single filers can exclude up to $250,000 of gain. Married couples filing jointly can exclude up to $500,000. 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 main home for at least two of the five years before the sale. The two years do not have to be consecutive. If you owned it for three years and lived there for two, you may have access to. If you owned it for five years but lived there for only one, you do not.
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 and one spouse used the exclusion on a different property within the past two years, the couple can still exclude $500,000 if both spouses meet the ownership and use tests for this property.
Rental properties, investment properties, and vacation homes do not may have access to for the exclusion. If you rented out part of your home or used part for business, you may lose the exclusion on that portion.
Depreciation recapture on rental and investment properties
If you owned the property as a rental or investment, you likely claimed depreciation deductions on your tax returns each year. When you sell, the IRS recaptures that depreciation and taxes it at 25% — higher than the long-term capital gains rate.
Example: You bought a rental house for $400,000 and claimed $100,000 in depreciation over ten years. Your adjusted basis is now $300,000. You sell for $500,000. Your total gain is $200,000. Of that, $100,000 is depreciation recapture taxed at 25% ($25,000 in tax). The remaining $100,000 is long-term capital gain taxed at your applicable rate (0%, 15%, or 20%).
Depreciation recapture applies only to the building and improvements, not the land. If you can separate the land value from the building value in your purchase documents, only the building portion is subject to recapture. This is one reason to keep detailed records of how much of your purchase price was allocated to land versus structure.
What happens if you inherit real estate
When you inherit real estate, you receive a stepped-up basis. Your basis becomes the fair market value of the property on the date of the owner's death, not what the original owner paid for it. This can eliminate or drastically reduce capital gains tax.
Example: Your parent bought a house in 1980 for $100,000. It is worth $800,000 when they die in 2024. Your basis is $800,000, not $100,000. If you sell immediately for $800,000, you owe no capital gains tax. If you sell later for $850,000, you owe tax only on the $50,000 gain.
The stepped-up basis applies whether you inherit through a will, trust, or intestacy. It applies to all real estate, not just primary residences. This is a major tax benefit of inheritance, though it may not apply to certain retirement accounts or property held in specific trust structures. Consult a tax professional about your specific situation.
Reporting capital gains on your tax return
You report real estate capital gains on Schedule D (Form 1040), which is part of your federal tax return. Schedule D asks for the date acquired, date sold, sales price, cost basis, and gain or loss. You then transfer the total to your main tax return.
If you used the primary residence exclusion, you report the full gain on Schedule D, then subtract the exclusion amount. The IRS wants to see the calculation. If you claimed depreciation, you also report the recapture separately.
The title company or real estate attorney usually provides a settlement statement showing the sale price and your net proceeds. This is not the same as your gain. Your gain is calculated by subtracting your basis from the sale price, not by subtracting expenses from the sale price. Keep your settlement statement, but calculate gain separately using basis.
If you sold the property in a year when you had other capital losses — from stock sales, for example — you can offset the real estate gain with those losses. This is reported on Schedule D as well.
Frequently Asked Questions
Do I owe capital gains tax if I sell at a loss?
No federal capital gains tax is owed if you sell for less than your basis. You have a capital loss instead. You can use capital losses to offset capital gains from other sales. If losses exceed gains, you can deduct up to $3,000 against ordinary income in that year, and carry forward unused losses to future years.
What if I sell real estate in a different state than where I live?
You owe federal capital gains tax regardless of where the property is located. You may also owe state tax in the state where the property is located, depending on that state's rules. Some states tax nonresidents on real estate sales; others do not. Check the rules in both your home state and the state where the property is.
Can I defer capital gains tax by doing a 1031 exchange?
A 1031 exchange allows you to sell one investment property and buy another similar property without paying capital gains tax at the time of sale. The gain is deferred, not eliminated. The rules are strict: you must identify the replacement property within 45 days and close within 180 days. This does not work for primary residences, only investment or business property.
Do I have to pay capital gains tax if I transfer property to my spouse?
No capital gains tax is owed when you transfer property to a spouse during marriage. The transfer is tax-free. If you transfer property in a divorce, the transfer is also tax-free if it is part of the divorce settlement. Capital gains tax is owed only when the property is later sold to a third party.
What if I sell real estate and receive payments over time instead of a lump sum?
You still owe capital gains tax in the year the sale closes, even if you receive the full payment later. If you receive payments over multiple years (an installment sale), you can use the installment method to spread the gain across the years you receive payments. This may lower your tax in any single year by keeping you in a lower tax bracket.