Capital gains tax on real estate is the tax you owe on the profit when you sell a property for more than you paid for it

When you sell a house, land, or rental property, the IRS taxes the difference between what you paid (your basis) and what you sold it for (your sale price). That difference is your capital gain. The tax rate depends on how long you owned the property and your income level. If you owned it for more than one year, you pay long-term capital gains tax, which is lower than ordinary income tax rates. If you owned it for one year or less, you pay short-term capital gains tax, which is taxed as regular income.

Real estate is treated differently from other investments in one important way: you can exclude up to $250,000 of gain if you're single, or $500,000 if you're married filing jointly, if you meet the ownership and use test. This means many people who sell a primary home owe no federal capital gains tax at all. Rental properties and investment real estate do not get this exclusion.

Key Takeaways

  • Capital gains tax applies to the profit you make when you sell real estate, calculated as the sale price minus your original purchase price and certain costs.
  • Long-term capital 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.
  • You can exclude up to $250,000 (single) or $500,000 (married) of gain on a primary home if you owned and lived in it for at least two of the last five years.
  • Rental properties, investment real estate, and second homes do not may have access to for the primary residence exclusion and are always subject to capital gains tax on the full profit.
  • Your basis includes the purchase price plus improvements like a new roof or addition, but not repairs or maintenance.

How your basis is calculated

Your basis is the starting point for calculating capital gains. It is usually the price you paid for the property, but it can be higher if you made capital improvements. Capital improvements are permanent upgrades that add value to the home, extend its life, or adapt it to new uses. Examples include adding a deck, replacing the roof, installing new plumbing or electrical systems, or finishing a basement.

Repairs and maintenance do not increase your basis. Painting, fixing a leak, or replacing a broken window are repairs, not improvements, even though you have to pay for them. The difference matters because a higher basis means a lower capital gain and lower tax.

If you inherited the property, your basis is usually the fair market value on the date the person died, not what they paid for it. This is called a stepped-up basis and can significantly reduce or eliminate capital gains tax if you sell soon after inheriting.

Long-term versus short-term capital gains rates

The tax rate on your real estate gain depends on how long you owned the property. If you held it for more than one year, you pay long-term capital gains tax. The rate is 0%, 15%, or 20% depending on your taxable income and filing status. These rates are lower than ordinary income tax rates, which go up to 37%.

If you sold the property within one year of buying it, you pay short-term capital gains tax. Short-term gains are taxed as ordinary income at your regular tax bracket rate. For most people, this is significantly higher than the long-term rate.

The IRS sets the income thresholds for each rate every year. For 2024, for example, the 15% long-term rate applies to single filers with taxable income between roughly $47,000 and $518,000, but these numbers change annually. Your tax professional or the IRS website can tell you which rate applies to your situation.

The primary residence exclusion

If you sell a home you lived in as your primary residence, you may not owe any capital gains tax on the profit. You can exclude up to $250,000 of gain if you file as single, or $500,000 if you file as married filing jointly. To use this exclusion, 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, and you can have been away for work or school during part of that time. If you owned the home for 20 years but lived in it for only one year, you do not meet the test. If you owned it for three years and lived in it for two of those years, you do.

You can use this exclusion only once every two years. If you sold a home and used the exclusion, you cannot use it again until two years have passed. This rule prevents people from buying, living in, and selling homes rapidly to avoid tax repeatedly.

Capital gains tax on rental and investment property

Rental properties and investment real estate do not may have access to for the primary residence exclusion. You owe capital gains tax on the entire profit, no matter how long you owned the property. However, you still benefit from the lower long-term capital gains rates if you held the property for more than one year.

Rental property owners also have to account for depreciation. When you rent out a property, you can deduct depreciation on the building (not the land) each year on your tax return. This lowers your taxable income while you own it, but it increases your capital gain when you sell. The IRS requires you to recapture the depreciation you deducted and pay tax on it at a rate of 25%, even if your long-term capital gains rate would be lower.

For example, if you bought a rental house for $300,000 and deducted $50,000 in depreciation over the years, your basis drops to $250,000. If you sell for $400,000, your total gain is $150,000. Of that, $50,000 is recaptured depreciation taxed at 25%, and $100,000 is long-term capital gain taxed at your regular rate.

State and local capital gains taxes

In addition to federal capital gains tax, some states and cities tax capital gains on real estate. The rules vary widely. Some states have no capital gains tax at all. Others tax capital gains as ordinary income at rates that can exceed 10%. A few states have a separate capital gains tax that applies only to investment income.

California, for instance, taxes capital gains as ordinary income, so the state rate can be as high as 13.3%. New York taxes capital gains as ordinary income with a top rate of 10.9%. Washington State has a capital gains tax of 7% on long-term gains over $250,000, but it does not explore to primary residences. Texas, Florida, and several other states have no state capital gains tax.

Your state of residence at the time of sale is what matters, not where the property is located. If you live in a state with no capital gains tax and sell a property in a state that does tax capital gains, you owe tax to the state where you live. Check your state's tax authority website or speak with a tax professional to understand what you owe.

How to report capital gains on your tax return

When you sell real estate, you report the transaction on Schedule D (Capital Gains and Losses) and Form 8949 (Sales of Capital Assets). You will need the sale price, your basis, the date you bought the property, and the date you sold it. If you used the primary residence exclusion, you report that on Form 8949 as well.

Your real estate agent or closing attorney will provide a settlement statement showing the sale price and closing costs. Keep records of all capital improvements you made, including receipts and invoices. If you inherited the property, keep the appraisal or valuation from the date of death to document your stepped-up basis.

If you sold the property at a loss, you can deduct the loss against other capital gains. If your capital losses exceed your capital gains, you can deduct up to $3,000 of the loss against ordinary income in that year, and carry forward any remaining loss to future years.

Frequently Asked Questions

Do I owe capital gains tax if I sell my primary home?

Not necessarily. If you owned and 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) of the gain. You owe tax only on any profit above that amount. Rental properties and investment real estate do not get this exclusion.

What counts as a capital improvement versus a repair?

A capital improvement adds value, extends the life of the property, or adapts it to new uses—like a new roof, deck, or finished basement. A repair fixes something broken or maintains it—like repainting or fixing a leak. Only improvements increase your basis and reduce your capital gain.

How do I know if I owe long-term or short-term capital gains tax?

If you owned the property for more than one year, you owe long-term capital gains tax at 0%, 15%, or 20% depending on your income. If you owned it for one year or less, you owe short-term capital gains tax at your ordinary income tax rate, which is usually higher.

What is depreciation recapture and why does it matter?

When you rent out a property, you deduct depreciation each year, which lowers your taxable income. When you sell, the IRS requires you to pay tax on that depreciation at 25%, regardless of your long-term capital gains rate. This is depreciation recapture.

Do I have to pay capital gains tax on inherited real estate?

Inherited property usually gets a stepped-up basis, meaning your basis is the fair market value on the date of death, not what the previous owner paid. If you sell soon after inheriting, you may owe little or no capital gains tax. If you hold it and it increases in value, you owe tax on the gain after the date of death.