The tax rate depends on how long you owned the property and your income level
Capital gains tax on real estate is calculated using the same rates as other investments, but real estate gets a special break: if you owned the property for more than one year before selling, you pay the long-term capital gains rate instead of your ordinary income tax rate. Long-term rates are 0%, 15%, or 20%, depending on your total income for the year. If you owned it for one year or less, you pay your regular income tax rate, which can be as high as 37%.
The gain itself is straightforward to calculate: sale price minus what you paid for it, minus certain costs. If you bought a house for $300,000, spent $50,000 on improvements, and sold it for $500,000, your gain is $150,000. That $150,000 is what gets taxed, not the full sale price.
Real estate also has one major exception: if the property is your primary residence, you can exclude up to $250,000 of gain if you're single, or $500,000 if you're married filing jointly. Most homeowners pay zero capital gains tax because their gain falls below that threshold.
Key Takeaways
- Long-term capital gains (property owned over one year) are taxed at 0%, 15%, or 20% based on your income; short-term gains use your ordinary tax rate, which is much higher.
- Your gain is the sale price minus your purchase price and the cost of improvements, not the full sale price.
- Homeowners can exclude $250,000 (single) or $500,000 (married) of gain on a primary residence if you meet the ownership and use tests.
- Investment properties and rental homes do not get the primary residence exclusion and may also owe a 3.8% net investment income tax if your income is above certain thresholds.
- State and local taxes add to your federal bill; some states tax capital gains as ordinary income, while others have no capital gains tax.
How the long-term capital gains brackets work
The 0%, 15%, and 20% rates are not applied to your entire gain. Instead, they depend on your taxable income for the year — which includes wages, business income, and the capital gain itself. The IRS stacks the gain on top of your other income and applies the rate that matches where it lands.
For 2024, the 0% rate applies to long-term gains that fall within the standard deduction or below certain income thresholds: roughly $47,025 for single filers and $94,050 for married couples filing jointly. The 15% rate applies to gains above that but below $518,900 (single) or $583,750 (married). Anything above those thresholds is taxed at 20%. These numbers change each year for inflation.
Example: You're single, earn $60,000 in wages, and sell a rental property for a $100,000 gain. Your taxable income is now $160,000. The first $47,025 of your gain falls in the 0% bracket (because it brings you to the threshold). The remaining $52,975 falls in the 15% bracket. You owe tax on $52,975 at 15%, or about $7,946, plus any state tax.
The primary residence exclusion and what it requires
If you sell your main home, you can exclude $250,000 of gain (or $500,000 if married filing jointly) from federal tax. This is one of the largest tax breaks available, and it applies even if your gain is much larger — you only pay tax on the amount above the exclusion.
To use this exclusion, you must meet two tests. First, you must have owned the home for at least two of the five years before the sale. Second, you must have lived in it as your primary residence for at least two of those same five years. The two years do not have to be consecutive, and they do not have to be the most recent two years, but they must fall within the five-year window.
If you're married filing jointly, both spouses must meet the ownership and use tests to claim the full $500,000 exclusion. If only one spouse meets the tests, you can exclude $250,000. If you're divorced or widowed, special rules may allow you to use your ex-spouse's ownership and use periods under certain conditions.
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. If you sell multiple properties in the same year, you can only use the exclusion on one of them.
What counts as an improvement versus routine maintenance
When you calculate your gain, you can subtract the cost of improvements you made to the property. An improvement adds value, prolongs the life of the property, or adapts it to a new use. Routine maintenance and repairs do not count.
Improvements include a new roof, an addition, a new HVAC system, a deck, new plumbing or electrical systems, or a kitchen remodel. Repairs include fixing a leak, patching drywall, repainting, or replacing a broken window. The line is not always clear, but the IRS test is whether the work is fixing something broken or making something better than it was before.
Keep receipts and invoices for all major work. When you sell, you'll report the cost of improvements on your tax return. If you cannot document the cost, you cannot deduct it, so the burden is on you to have records. For a primary residence, this matters less because of the exclusion, but for rental or investment property, every dollar of documented improvement reduces your taxable gain.
Investment properties and rental homes face higher taxes
If the property is not your primary residence — if it's a rental, a vacation home, or land held for investment — you do not get the $250,000 or $500,000 exclusion. You pay tax on the entire gain at the long-term rate (0%, 15%, or 20%) if you held it over one year.
Investment properties also owe an additional 3.8% net investment income tax if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). This tax applies to the lesser of your net investment income or the amount your income exceeds the threshold. For someone with $300,000 in income and a $100,000 gain on a rental property, the 3.8% tax would explore to the full $100,000 gain, adding $3,800 to the bill.
Rental properties also have a special rule called depreciation recapture. If you deducted depreciation on the property over the years you owned it, you must "recapture" that depreciation when you sell. The recaptured amount is taxed at 25%, not the long-term rate. This can significantly increase your tax bill even if the long-term rate is only 15%.
State and local taxes on capital gains
Federal capital gains tax is only part of the bill. Most states tax capital gains as ordinary income, meaning you pay your state income tax rate on top of the federal rate. A few states have no income tax at all (Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming), so residents pay only federal tax. A handful of others tax capital gains at a special rate or only on certain types of gains.
California, for example, taxes capital gains as ordinary income with rates up to 13.3%. New York's top rate is 10.9%. If you live in a high-tax state and sell a property with a large gain, state tax can add thousands to your bill. Some states also have local income taxes on top of the state rate.
If you sell property in one state but live in another, you may owe tax to both states. The state where the property is located usually has the primary claim, but your home state may also tax the gain. You can often claim a credit for taxes paid to another state, but the rules vary. If you're selling out-of-state property, consult a tax professional in your state to understand the full picture.
How to report capital gains on your tax return
Capital gains from real estate sales are reported on Schedule D (Capital Gains and Losses), which you attach to your Form 1040. You'll also receive a Form 1099-S from the title company or settlement agent if the sale price exceeds $600 (or $5,000 in some cases, depending on state rules). The 1099-S reports the gross sale price, not your gain, so you must calculate the gain yourself.
On Schedule D, you list the property, the date acquired, the date sold, the sale price, your cost basis (purchase price plus improvements), and the gain or loss. If you used the primary residence exclusion, you note that on the form. The gain then flows to your Form 1040, where it's combined with other income to determine your tax bracket and any additional taxes owed.
If you have a loss — you sold for less than you paid — you can deduct it against capital gains from other sales. If losses exceed gains, you can deduct up to $3,000 of the net loss against ordinary income in that year, and carry forward any remaining loss to future years.
Frequently Asked Questions
Do I have to pay capital gains tax if I sell my primary home?
Not if your gain is under $250,000 (single) or $500,000 (married filing jointly). Most homeowners fall below this threshold and owe no federal capital gains tax. You must have owned and lived in the home for at least two of the five years before the sale to use the exclusion.
What if I owned the property for less than a year before selling?
You pay short-term capital gains tax, which is your ordinary income tax rate — as high as 37%. This applies whether it's a primary residence, rental, or investment property. The primary residence exclusion still applies if you meet the ownership and use tests, but you lose the benefit of the lower long-term rates.
Can I deduct the cost of selling, like realtor commissions and closing costs?
Yes. Selling costs reduce your net proceeds and therefore your gain. If you paid a 6% realtor commission, title insurance, and transfer taxes, all of those reduce the sale price used to calculate your gain. Keep all closing statements and settlement documents as proof.
What happens if I inherited the property — does my cost basis reset?
Yes. When you inherit property, your cost basis "steps up" to the fair market value on the date of death. 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 a year later for $420,000, your gain is only $20,000, not $320,000. This is a major tax benefit of inherited property.
Do I owe capital gains tax if I sell at a loss?
No. If you sell for less than you paid, you have a loss, not a gain. You cannot use the loss to reduce your income tax unless it's from an investment property or business property. For a primary residence, losses are not deductible at all. For investment property, you can deduct losses against other capital gains, or up to $3,000 against ordinary income per year.