What 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 your total income for the year — not on the sale price itself.

Real estate capital gains work the same way as gains from selling stocks or other assets, but real estate has special rules. You may owe federal tax, state tax (if your state has income tax), and possibly a 3.8% net investment income tax if your income is high enough. Some homeowners pay nothing because the law lets you exclude up to $250,000 of gain if you lived in the house as your main home for at least two of the last five years — or $500,000 if you are married filing jointly.

The math is straightforward: sale price minus what you paid (your basis) equals your gain. But basis can include closing costs, improvements you made, and depreciation you claimed on a rental property, so the actual gain is often smaller than the sale price suggests.

Key Takeaways

  • Capital gains tax applies to the profit when you sell real estate, not the full sale price, and the rate depends on how long you owned it.
  • If you lived in the house as your main home for at least two of the last five years, you can exclude $250,000 of gain (or $500,000 if married filing jointly) from federal tax.
  • Long-term gains (property owned over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
  • Your basis includes what you paid plus closing costs and improvements, so keeping records of all expenses reduces your taxable gain.
  • Rental properties and investment land do not may have access to for the main home exclusion and may also owe depreciation recapture tax.

Long-term versus short-term capital gains on real estate

How long you owned the property determines which tax rate applies. If you owned it for more than one year before selling, it is a long-term capital gain. If you owned it for one year or less, it is a short-term capital gain.

Short-term gains are taxed as ordinary income — the same rate as your wages or salary. That rate can be as high as 37% depending on your tax bracket. Long-term gains are taxed at lower rates: 0%, 15%, or 20%, depending on your income level. For 2024, the 0% rate applies to single filers with income under $47,025; the 15% rate applies up to $518,900; and 20% applies above that. These income thresholds change each year.

Real estate almost always qualifies as long-term because most people own a house or investment property for years. Short-term real estate sales are rare and usually happen only when someone buys and flips a property quickly.

How to calculate your capital gain on real estate

Start with your adjusted basis — what you paid for the property plus certain costs. Include the purchase price, closing costs (title insurance, appraisal, attorney fees), and the cost of any improvements you made (a new roof, addition, or major renovation). Do not include maintenance or repairs, which are not added to basis.

Subtract your adjusted basis from the sale price. The result is your capital gain. For example: you bought a house for $300,000, paid $6,000 in closing costs, and made $40,000 in improvements. Your basis is $346,000. You sell it for $500,000. Your gain is $154,000.

If you owned the house as your main home, you can subtract the exclusion ($250,000 for single filers, $500,000 for married filing jointly). In the example above, a single filer would owe tax on $154,000 minus $250,000 — which is zero, so no federal capital gains tax is due. A married couple would also owe nothing.

Keep receipts and records for everything you paid to buy and improve the property. The IRS does not ask for them when you file, but if you are audited, you will need to prove your basis.

The main home exclusion and who qualifies

The Section 121 exclusion lets you exclude capital gains if the property was your main home. You must have owned it and lived in it as your primary residence for at least two of the five years before you sold it. The two years do not have to be consecutive.

Single filers can exclude up to $250,000 of gain. Married couples filing jointly can exclude up to $500,000. You can use this exclusion only once every two years, so if you sold a home and used the exclusion, you cannot use it again for another home until two years have passed.

Rental properties, vacation homes, and investment land do not may have access to for this exclusion. If you rented out part of your home during the years you owned it, the exclusion may be reduced based on the percentage of time it was rented. Talk to a tax professional if your situation is mixed.

Depreciation recapture on rental and investment property

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 requires you to "recapture" that depreciation — meaning you owe tax on it at a 25% rate, separate from the capital gains tax.

For example: you bought a rental house for $300,000 and claimed $60,000 in depreciation over ten years. You sell it for $400,000. Your capital gain is $100,000. You owe 25% tax on the $60,000 depreciation ($15,000) plus long-term capital gains tax on the remaining $40,000 of gain. Depreciation recapture applies even if your total gain is small or zero.

This is one reason to keep detailed records of depreciation claimed. When you sell, you will need to report it on Form 8949 and Schedule D, and your tax software or preparer will calculate the recapture amount.

State and local taxes on real estate sales

Federal capital gains tax is only part of the bill. Most states with income tax also tax capital gains on real estate at their ordinary income rates. State rates vary widely — from under 5% in some states to over 13% in others. A few states (like Florida, Texas, and Wyoming) have no income tax at all.

Some states tax capital gains differently than ordinary income. California, for example, taxes long-term capital gains at the same rate as ordinary income. New York taxes long-term gains at ordinary rates too. Other states may have lower rates or special rules for real estate.

You may also owe a net investment income tax of 3.8% if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). This is a federal tax, not a state tax, and it applies to capital gains, dividends, and other investment income.

What to report on your tax return

Report the sale on Form 8949 (Sales of Capital Assets). List the property, the date you bought it, the date you sold it, your basis, the sale price, and your gain or loss. Form 8949 feeds into Schedule D (Capital Gains and Losses), where you separate long-term from short-term gains and calculate your total.

If you used the main home exclusion, you do not report the excluded gain on Form 8949 or Schedule D — you straightforward do not include it. Only report the gain that is subject to tax.

If you sold a rental property and owe depreciation recapture, that goes on Form 8949 as well, and your tax software will calculate the 25% recapture tax separately from the capital gains tax. If you are using a tax professional, give them the closing statement from the sale and a record of your basis and any depreciation claimed.

Frequently Asked Questions

Do I owe capital gains tax if I sell my house at a loss?

No. If you sell for less than your basis, you have a capital loss, not a gain. You cannot deduct a loss on the sale of your main home. If you sold a rental property or investment land at a loss, you can use that loss to offset other capital gains, and up to $3,000 of loss can offset ordinary income in one year.

What if I inherited real estate and then sold it?

Inherited property receives a "step-up in basis," meaning your basis is the fair market value on the date of death, not what the previous owner paid. If you sell it shortly after inheriting it, you likely owe little or no capital gains tax. Keep the appraisal or valuation from the estate.

Can I defer capital gains tax by buying another property?

Not with real estate. A 1031 exchange lets you defer tax by selling one investment property and buying another similar one within strict timelines, but this does not explore to your main home. Consult a tax professional if you are considering a 1031 exchange.

How do I report the sale if I used a real estate agent?

The real estate agent does not report the sale to the IRS — you do. You will receive a closing statement from the title company or attorney showing the sale price and your net proceeds. Use that to calculate your gain and report it on Form 8949 and Schedule D.

What if I sold the property 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 tax to 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 for the state where you sold.