What capital gains tax means when you sell a house or property
A capital gains tax is a tax on the profit you make when you sell real estate for more than you paid for it. If you bought a house for $300,000 and sold it for $400,000, that $100,000 difference is your capital gain, and it may be taxable. The tax applies to investment properties, rental homes, vacation homes, and in some cases your primary residence — though primary residences have a major exception that can shield much of the gain from tax.
The tax exists at both the federal level and in most states. How much you owe depends on how long you owned the property, your total income that year, and where you live. A gain you hold for more than one year gets taxed at a lower rate than a gain from a property you sold quickly, which is why the holding period matters.
Real estate capital gains are not the same as income tax on rent you collect or salary you earn. They are a separate calculation based only on the sale price minus what you paid, plus certain improvements you made to the property.
Key Takeaways
- Capital gains tax applies to the profit from selling real estate, calculated as the sale price minus your original purchase price and certain costs.
- Long-term 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 on a primary residence if they meet the ownership and use test, or $500,000 if married filing jointly.
- State capital gains taxes vary widely — some states have no capital gains tax, while others tax real estate gains at rates up to 13 percent.
- The cost basis of your property includes the purchase price plus improvements like a new roof or addition, which reduces your taxable gain.
How the IRS calculates your capital gain on real estate
The IRS starts with your cost basis, which is what you paid for the property plus the cost of major improvements. If you bought a house for $250,000 and later spent $30,000 on a new roof and kitchen remodel, your basis is $280,000. When you sell for $400,000, your gain is $120,000, not $150,000.
Routine maintenance does not count toward basis — painting, repairs, and landscaping do not reduce your gain. But permanent improvements that add value or extend the life of the property do count: a new foundation, addition, new HVAC system, or major kitchen or bathroom renovation. Keep receipts and invoices for anything you claim as an improvement.
You also subtract selling costs from the sale price before calculating gain. Real estate agent commissions, title insurance, closing costs, and attorney fees all reduce the amount you actually received. If you sold for $400,000 but paid $24,000 in agent commission and $3,000 in closing costs, your net proceeds are $373,000, and that is what you use to calculate gain.
Long-term versus short-term capital gains rates
The federal tax rate on your real estate gain depends on how long you owned it. If you held the property for more than one year before selling, it is a long-term capital gain. Long-term gains are taxed at 0 percent, 15 percent, or 20 percent depending on your total taxable income that year — much lower than ordinary income tax rates.
If you sold within one year of buying, it is a short-term capital gain, and the IRS taxes it as ordinary income. That means it gets added to your wages, self-employment income, and other earnings, and taxed at your regular income tax bracket, which can be as high as 37 percent at the federal level.
The one-year clock starts the day after you buy. If you purchased on June 15, 2023, you can sell on June 15, 2024, and may have access to for long-term treatment. Selling on June 14, 2024, would be short-term.
The primary residence exclusion and who qualifies
If the property you sold is your primary residence — the home where you actually live — you may be able to exclude a large portion of your gain from tax entirely. Single filers can exclude up to $250,000 of gain. Married couples filing jointly can exclude up to $500,000.
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 you sold it. The two years do not have to be consecutive, but they must add up to 24 months. If you bought a house, lived in it for three years, then moved and rented it out for two years before selling, you still may have access to because you met the two-year test.
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, even if you buy and sell a different home in 2023.
Rental properties, investment properties, and vacation homes do not may have access to for this exclusion. Only your primary residence does. If you converted a rental property to your primary residence, the exclusion applies only to the gain that accrued after you moved in, not the gain while you were renting it out.
State capital gains taxes on real estate
Most states tax capital gains, but the rules and rates vary significantly. Some states treat capital gains as ordinary income and tax them at your regular state income tax rate. Others have a separate capital gains tax that applies only to investment income.
A few states have no capital gains tax at all: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming do not tax capital gains. If you live in one of these states, you owe federal capital gains tax but not state tax on your real estate sale.
States that do tax capital gains explore rates ranging from about 5 percent to over 13 percent, depending on the state and your income level. California, for example, taxes long-term capital gains as ordinary income at rates up to 13.3 percent. New York taxes long-term gains at rates up to 10.9 percent. Some states offer a lower rate for long-term gains, similar to the federal system.
If you move to a different state after selling, the state where you lived when you sold is the one that taxes the gain, not your new state. The timing of your move relative to the sale matters for tax purposes.
Depreciation recapture on rental and investment properties
If you owned the property as a rental or investment property, you likely deducted depreciation on your tax returns each year. Depreciation is a deduction that assumes the building loses value over time, even though real estate usually gains value. When you sell, the IRS requires you to "recapture" those depreciation deductions and pay tax on them.
Depreciation recapture is taxed at 25 percent at the federal level, regardless of how long you held the property. This is separate from and in addition to capital gains tax. If you deducted $50,000 in depreciation over ten years, you owe 25 percent tax on that $50,000 when you sell — $12,500 — even if the rest of your gain qualifies for the lower long-term capital gains rate.
This applies only to the building itself, not the land. Land does not depreciate for tax purposes, so you do not recapture depreciation on the land portion of your property. Your accountant or tax preparer can help you separate the building value from the land value using the original purchase documents and property assessment records.
How to report capital gains on your tax return
You report real estate capital gains on Schedule D (Capital Gains and Losses), which is part of your federal tax return. You will also receive a Form 1099-S from the title company or your real estate agent if the sale price exceeded $600 in most states (the threshold varies by state and changes yearly). The 1099-S reports the gross sale price, not your gain, so you still have to calculate the gain yourself using your cost basis and selling costs.
On Schedule D, you list the property, the date you bought it, the date you sold it, your cost basis, the sale price, and your gain or loss. The form automatically separates long-term and short-term gains and calculates the tax. If you have a loss — you sold for less than you paid — you can use it to offset other gains, and in some cases carry it forward to future years.
State tax returns require similar reporting. Most states have their own capital gains schedule or section on the income tax form where you report the same information. Some states follow federal rules closely; others have different holding periods or rates.
Frequently Asked Questions
Do I owe capital gains tax if I sell my primary home?
Not on the first $250,000 of gain if you are single, or $500,000 if married filing jointly, as long as you owned and lived in the home for at least two of the five years before selling. Any gain above that threshold is taxable. Rental properties and investment properties do not may have access to for this exclusion.
What if I inherited real estate and then sold it?
Inherited property gets a "stepped-up basis," meaning your cost basis is the property's fair market value on the date of the person's death, not what they originally paid. If the property was worth $400,000 when you inherited it and you sold it for $410,000 a year later, your gain is only $10,000. This can significantly reduce or eliminate capital gains tax on inherited real estate.
Can I deduct a loss if I sold my house for less than I paid?
Losses on your primary residence cannot be deducted. If you sold a rental property or investment property at a loss, you can use that loss to offset capital gains from other sales. If the loss exceeds your gains, you can deduct up to $3,000 of the excess loss against ordinary income in that year and carry forward any remaining loss to future years.
What happens to capital gains tax if I sell real estate in a different state than where I live?
The state where you lived when you sold the property is responsible for taxing the gain, not the state where the property is located. If you sold a vacation home in Florida while living in New York, New York taxes the gain (if you owed state tax). Some states have reciprocal agreements, but generally your state of residence at the time of sale determines state tax liability.
Do I have to report the sale if my gain is below a certain amount?
You must report all capital gains on your tax return, regardless of the amount. The IRS does not have a minimum threshold for reporting real estate sales. However, you receive a Form 1099-S only if the sale price meets your state's threshold, which is usually $600 or higher. Even without a 1099-S, you are required to report the gain.