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

The tax applies to the difference between your sale price and your cost basis — which is usually what you paid for the property, plus the cost of major improvements like a new roof or addition. If you bought a house for $300,000, spent $50,000 on renovations, and sold it for $500,000, your capital gain is $150,000 ($500,000 minus $350,000). That $150,000 is what gets taxed, not the full sale price.

The tax rate depends on how long you owned the property. If you held it for more than one year, you pay long-term capital gains tax at federal rates of 0%, 15%, or 20%, depending on your income. If you sold it within one year, you pay short-term capital gains tax at your ordinary income tax rate, which can be as high as 37%. Most homeowners may have access to for long-term rates because they own their homes for years.

Many states also tax capital gains on real estate sales. Some states have no capital gains tax at all; others tax it as ordinary income. Your state tax bill depends on where you live and where the property is located.

Key Takeaways

  • You only pay capital gains tax on the profit from the sale, not the full sale price, and you can subtract the cost of major improvements from what you owe tax on.
  • Long-term capital gains (property held over one year) are taxed at federal rates of 0%, 15%, or 20% based on your total income, while short-term gains are taxed as ordinary income at rates up to 37%.
  • Your primary residence may be exempt from capital gains tax if you meet the ownership and use test: you owned and lived in the home for at least two of the last five years, and you can exclude up to $250,000 of gain if you are single or $500,000 if you are married filing jointly.
  • State capital gains taxes vary widely — some states do not tax capital gains at all, while others tax them as regular income, so your total tax bill depends on your location.
  • You report capital gains on Schedule D (Form 1040) when you file your federal return, and you will need the original purchase price, sale price, and documentation of any improvements you made.

The difference between long-term and short-term capital gains rates

If you owned the real estate for more than one year before selling, the IRS treats the gain as long-term. Long-term capital gains are taxed at preferential rates: 0%, 15%, or 20% at the federal level. Which rate you pay depends on your taxable income for the year. For 2024, the 0% rate applies to single filers with taxable income up to $47,025; the 15% rate applies to income between roughly $47,025 and $518,900; and the 20% rate applies to income above that. These income thresholds change each year.

If you owned the property for one year or less, the gain is short-term and taxed as ordinary income. Your ordinary income tax rate can be 10%, 12%, 22%, 24%, 32%, 35%, or 37%, depending on your total income and filing status. Short-term gains are added to your other income for the year, which often pushes you into a higher tax bracket. This is why holding a property longer than one year usually saves you money in federal tax.

The one-year clock starts the day after you buy the property and ends the day you sell it. If you bought on January 15, 2023, and sold on January 15, 2024, you do not meet the one-year test — you need to sell on January 16, 2024 or later.

How the primary residence exemption reduces or eliminates your tax bill

If you are selling your main home, you may not owe any capital gains tax at all. The IRS allows you to exclude (not deduct, but completely exclude from taxation) up to $250,000 of capital gain if you are single, or $500,000 if you are married filing jointly. This exclusion is one of the largest tax breaks available to homeowners.

To use this exclusion, you must meet two tests. First, you must have owned the home for at least two of the last five years before the sale. Second, you must have lived in the home as your primary residence for at least two of the last five years. These do not have to be the same two years — you could have owned it for five years but lived in it for only two of those years and still may have access to. If you inherited a home and lived in it for two years, you may have access to. If you bought a home, rented it out for three years, then moved in and lived in it for two years, you also may have access to.

If your capital gain exceeds the exclusion amount, you owe tax only on the excess. A single person who sells a primary residence for a $400,000 gain owes tax on $150,000 ($400,000 minus the $250,000 exclusion). A married couple with a $600,000 gain owes tax on $100,000 ($600,000 minus the $500,000 exclusion).

What counts as your cost basis and what improvements you can include

Your cost basis is the starting point for calculating your gain. It is usually the price you paid for the property, but it can be higher if you made capital improvements. A capital improvement is a permanent upgrade that adds value, prolongs the life of the property, or adapts it to a new use. Examples include a new roof, a room addition, a new HVAC system, a deck, or a kitchen remodel. You cannot deduct routine maintenance like painting, repairs, or lawn care.

Keep receipts and invoices for all major work. If you paid $300,000 for a house and spent $40,000 on a new roof and $25,000 on a kitchen remodel, your basis is $365,000. When you sell for $500,000, your gain is $135,000, not $200,000. This can save you thousands in tax.

If you inherited the property, your basis is usually the fair market value on the date of the person's death, not what they originally paid. This is called a step-up in basis and can eliminate capital gains tax entirely if you sell soon after inheriting. 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 for $410,000 a month later, your gain is only $10,000.

State capital gains taxes and how they affect your total bill

Federal capital gains tax is only part of your bill. Many states also tax capital gains on real estate sales, and the rates and rules vary widely. Some states — including Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming — do not tax capital gains at all. Other states tax capital gains as ordinary income, meaning your state rate could be 5%, 10%, or higher depending on your income and location.

A few states have separate capital gains tax rates. California taxes long-term capital gains as ordinary income at rates up to 13.3%. New York taxes them as ordinary income at rates up to 10.9%. Some states offer exemptions for primary residences similar to the federal rule; others do not. You need to check the rules in the state where you live and the state where the property is located, because some states tax gains on property sold by residents even if the property is out of state.

If you are selling a rental property or investment real estate, you cannot use the primary residence exclusion, so you will owe both federal and state capital gains tax on the full gain. This is one reason rental property owners often use strategies like 1031 exchanges to defer the tax, though that is a separate and complex topic.

How to report capital gains on your tax return

You report real estate capital gains on Schedule D (Form 1040), which is the IRS form for reporting gains and losses from the sale of assets. You list the property, the date you bought it, the date you sold it, your cost basis, the sale price, and the gain or loss. If you are using the primary residence exclusion, you note that on the form as well.

You will need several documents: the original purchase deed or closing statement showing what you paid, the sale closing statement showing the sale price, and receipts or invoices for any capital improvements. If you inherited the property, you need documentation of the fair market value on the date of death. If you used part of the home for business (like a home office), you may need to calculate what portion of the gain is taxable.

If the gain is large or your situation is complex — for example, if you are selling rental property, inherited property, or property you owned with someone else — consider working with a tax professional. Capital gains calculations can interact with other parts of your return, and mistakes can be costly.

Frequently Asked Questions

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

No. If you sell your primary residence for less than you paid for it, you have a capital loss, and you cannot deduct it on your tax return. Capital losses on personal residences are not deductible. However, if you sell rental or investment property at a loss, you can use that loss to offset capital gains from other sales.

What if I owned the home with my spouse and we are now divorced?

If you transfer the home to your spouse as part of a divorce settlement, there is no capital gains tax on the transfer itself. When the home is eventually sold, the person who owns it at the time of sale reports the gain. If you both owned it and both lived in it, you may each be able to use the primary residence exclusion when you sell, though the rules depend on the timing and your filing status at the time of sale.

Can I avoid capital gains tax by gifting the home to my children instead of selling it?

You can gift the home without triggering capital gains tax for yourself, but your children will inherit your original cost basis, not a stepped-up basis. When they eventually sell, they will owe tax on the gain from your original purchase price. If you wait and let them inherit after your death, they get a stepped-up basis and may owe little or no tax when they sell.

Do I have to report the sale if the gain is under a certain amount?

Yes. There is no minimum gain threshold for reporting. Even if your gain is $1, you must report it on Schedule D. The primary residence exclusion is what reduces or eliminates your tax liability, not a reporting threshold.

What if I sold the property years ago and did not report the gain?

The IRS can go back and assess tax, penalties, and interest for prior years. If you missed reporting a capital gain, you can file an amended return (Form 1040-X) for the year of the sale. It is better to file late than not to file at all, because the statute of limitations does not start until you file a return.