How Capital Gains Tax Works When You Sell Real Estate
What the capital gains tax on real estate means
When you sell a house, land, or rental property for more than you paid for it, the profit is called a capital gain. The IRS taxes that profit as income. The tax rate depends on how long you owned the property and how much your total income is that year.
Real estate capital gains are taxed differently than the salary you earn at work. The IRS separates them into two categories based on ownership time: short-term gains (you owned it less than a year) and long-term gains (you owned it a year or longer). Long-term gains usually have lower tax rates, which is why holding a property longer often saves you money in taxes.
The calculation itself is straightforward: you subtract what you paid for the property (your basis) from what you sold it for (the sale price), then subtract any deductible expenses like real estate agent commissions. That number is your taxable gain.
Key Takeaways
- Short-term capital gains on real estate are taxed as ordinary income at your regular tax bracket rate, which can be as high as 37 percent depending on your income level.
- Long-term capital gains (property owned over one year) are taxed at lower rates: 0 percent, 15 percent, or 20 percent depending on your total income for the year.
- Your capital gain is the sale price minus what you originally paid, minus selling costs like agent commissions and closing fees.
- If you lived in the home as your primary residence for at least two of the last five years, you may exclude up to $250,000 (or $500,000 if married filing jointly) of the gain from taxation.
- State and local taxes may also explore to your real estate gain, and these rates vary by location.
Short-term versus long-term capital gains rates
If you sell a property you owned for less than one year, your profit is taxed as short-term capital gain. The IRS treats this like regular wages and taxes it at your ordinary income tax bracket. For 2024, those brackets range from 10 percent to 37 percent depending on how much total income you have that year.
If you owned the property for one year or longer before selling, your profit is a long-term capital gain. These are taxed at preferential rates: 0 percent, 15 percent, or 20 percent. Which rate applies depends on your income level, not on the property itself. A person in a lower income bracket might pay 0 percent on a long-term gain, while someone in a higher bracket pays 20 percent on the same property sold for the same price.
The difference can be substantial. If you sell a rental property after owning it eleven months and your gain is $100,000, you might owe $24,000 in federal tax (at the 24 percent bracket). If you wait one more month and sell it as a long-term gain, you might owe $15,000 (at the 15 percent rate). That one month of waiting saved $9,000.
How to calculate your capital gain on real estate
Start with your adjusted basis, which is usually what you paid for the property plus the cost of major improvements. Major improvements are things that add value or extend the life of the property—a new roof, a deck, or a kitchen renovation. Routine maintenance like painting or fixing a leak does not count.
Subtract your adjusted basis from the sale price. Then subtract your selling costs: real estate agent commission (typically 5 to 6 percent), title insurance, closing costs, and any other fees paid to sell the property. What remains is your taxable capital gain.
Example: You bought a house for $300,000. You added a $50,000 addition. Your adjusted basis is $350,000. You sell it for $500,000. Your selling costs are $25,000 (agent commission and closing fees). Your capital gain is $500,000 − $350,000 − $25,000 = $125,000.
Keep records of what you paid for the property, receipts for improvements, and all closing documents from both the purchase and the sale. The IRS may ask to see them if you are audited.
The primary residence exclusion
If the property you are selling is your primary home—the place you actually live—you may be able to exclude part or all of your capital gain from taxation. You must have lived in the home for at least two of the last five years before the sale.
The exclusion amount is $250,000 if you are single, or $500,000 if you are married filing jointly. This means if you lived in your home for two of the last five years and your gain is $200,000, you owe no federal capital gains tax on it. If your gain is $600,000 and you are married filing jointly, you owe tax only on $100,000 of the gain.
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 applies only to your primary residence, not to investment properties, vacation homes, or rental properties.
State and local taxes on real estate gains
In addition to federal capital gains tax, most states tax capital gains as income. The state tax rate depends on where you live and how much you earned that year. Some states have no income tax at all (like Florida, Texas, and Wyoming), so residents of those states pay only federal capital gains tax. Others, like California and New York, have state capital gains taxes that can be 10 percent or higher.
A few states tax capital gains differently than ordinary income. Some explore a flat rate regardless of your income level. Others use income brackets similar to the federal system. You will need to check your state's tax rules or consult a tax professional to know what you owe.
Local taxes also exist in some cities and counties. These are less common but can add another 1 to 3 percent to your tax bill depending on where the property is located.
Capital gains tax on investment and rental properties
If you sell a rental property or investment property (anything other than your primary home), you cannot use the primary residence exclusion. You pay capital gains tax on the full profit, with no dollar limit on what you can exclude.
However, if you owned a rental property for more than one year, you still benefit from the lower long-term capital gains rates (0, 15, or 20 percent) instead of ordinary income rates. This is one reason real estate investors hold properties for longer than a year before selling.
Rental properties have an additional tax consideration: depreciation recapture. If you deducted depreciation on the property while you rented it out, the IRS taxes that depreciation back at a 25 percent rate when you sell, separate from your capital gains tax. This applies even if your capital gain itself would be taxed at a lower rate. Keep records of all depreciation deductions you claimed.
What happens if you have a capital loss on real estate
If you sell a property for less than you paid for it (including improvements and adjusted basis), you have a capital loss. You cannot deduct a capital loss on your primary residence. The loss straightforward disappears for tax purposes.
If you have a capital loss on an investment property, you can use it to offset capital gains from other investments that year. If your losses exceed your gains, you can deduct up to $3,000 of the net loss against ordinary income. Any remaining loss carries forward to future years, where you can use it the same way.
Frequently Asked Questions
Do I owe capital gains tax if I sell my primary home?
Not necessarily. If you lived in the home for at least two of the last five years, you can exclude up to $250,000 (single) or $500,000 (married filing jointly) of the gain. You owe tax only on any gain above that amount. If your gain is less than the exclusion, you owe nothing.
How long do I need to own a property to get the lower long-term capital gains rate?
You must own it for more than one year. The IRS counts from the date you acquired it to the date you sold it. If you bought on January 15 and sold on January 16 of the next year, that is long-term. If you sold on January 15, it is short-term.
Can I deduct the cost of selling the property from my capital gain?
Yes. Real estate agent commissions, title insurance, closing costs, and other fees paid to sell the property reduce your taxable gain. Keep all closing documents and receipts. These are different from the cost of buying the property, which is part of your basis.
What if I inherited a property and then sold it?
Inherited property receives a "step-up in basis," meaning your basis is the property's value on the date of the person's death, not what they originally paid. If you inherit a house worth $400,000 and sell it for $410,000 a few months later, your gain is only $10,000, not the full difference from the original purchase price decades earlier.
Do I have to report the sale to the IRS even if I have no gain?
Yes. You report the sale on Form 8949 and Schedule D, regardless of whether you have a gain, loss, or break even. The IRS receives a copy of the closing statement from the title company, so they know the sale happened. Report it accurately even if you owe no tax.
This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.