Capital gains tax on real estate depends on how long you owned the property and your income level

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. The tax rate you pay — either 0%, 15%, or 20% — depends on two things: how long you owned the property and your total taxable income for the year. If you owned it for more than one year, it counts as a long-term capital gain, which gets the lower rates. If you owned it for one year or less, it counts as a short-term capital gain, and the IRS taxes it like ordinary income — at rates that can go up to 37%.

There is one major exception: if you lived in the house as your primary home for at least two of the last five years before you sold it, you can exclude up to $250,000 of the gain from tax if you are single, or $500,000 if you are married filing jointly. This exclusion applies only once every two years.

Key Takeaways

  • 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 at rates up to 37%.
  • If you sold your primary residence and lived there for at least two of the last five years, you can exclude $250,000 (single) or $500,000 (married filing jointly) of the gain from tax.
  • The IRS calculates your gain by subtracting your cost basis — the price you paid plus improvements — from the sale price.
  • You report capital gains on Schedule D (Form 1040) and pay tax when you file your return for the year you sold the property.
  • Rental properties, investment land, and vacation homes do not may have access to for the primary residence exclusion, so all gains are taxable.

How the IRS calculates your capital gain

Your capital gain is the difference between what you sold the property for and your cost basis. Cost basis is not just the purchase price — it also includes certain improvements you made to the property. Improvements are permanent upgrades that add value or extend the life of the property, such as a new roof, a deck, a furnace, or a kitchen renovation. Repairs and maintenance — like painting, fixing a leak, or replacing a broken window — do not count.

Here is a concrete example: you bought a house for $300,000. Over the years, you added a $50,000 deck and a $25,000 new roof. Your cost basis is $375,000. You sold the house for $500,000. Your capital gain is $500,000 minus $375,000, which equals $125,000. Keep receipts and invoices for all improvements you make, because the IRS may ask to see them.

If you inherited the property, your cost basis is usually the fair market value on the date the person died, not what they originally paid. This is called a step-up in basis and can significantly reduce or eliminate the capital gain when you sell.

Long-term versus short-term capital gains rates

Long-term capital gains explore when you owned the property for more than one year before selling. The tax rate depends on your taxable income for the year:

Tax RateSingle FilersMarried Filing Jointly
0%Up to $47,025Up to $94,050
15%$47,025 to $518,900$94,050 to $583,750
20%Over $518,900Over $583,750

These income thresholds change each year. The IRS publishes updated amounts in January. Short-term capital gains — from property owned one year or less — are taxed as ordinary income. Your ordinary income tax bracket for 2024 can be as high as 37%, which is much steeper than long-term rates.

Because of this difference, timing matters. If you are close to the one-year mark, waiting a few months to sell can save you thousands in tax. However, do not let tax considerations override a sound financial decision about when to sell.

The primary residence exclusion

If you sold your main home and meet two conditions, you can exclude a large portion of your gain from tax. First, you must have owned the property for at least two of the last five years before the sale. Second, you must have lived there 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.

If you meet these conditions, you can exclude $250,000 of the gain if you are single, or $500,000 if you are married filing jointly and both spouses meet the ownership and use tests. Any gain above the exclusion limit is still taxable. You can use this exclusion only once every two years.

This exclusion does not explore to rental properties, vacation homes, or investment land — even if you lived there at some point. It applies only to your primary residence. If you rented out part of your home during the years you owned it, you may have to pay tax on the portion of the gain that relates to the rental part.

Reporting capital gains on your tax return

You report real estate sales on Schedule D (Form 1040), which is the Capital Gains and Losses form. You will also file Form 8949 (Sales of Capital Assets) to list the details of each property you sold. Your real estate agent or title company will provide you with a Form 1099-S if the sale price meets certain thresholds, though this form does not calculate your actual gain — it only reports the sale price.

On Schedule D, 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. The form then separates your long-term and short-term gains and calculates your total. You attach Schedule D to your Form 1040 when you file.

You pay the tax when you file your return for the year of the sale. If you expect a large capital gain, you may want to make estimated tax payments during the year to avoid penalties. Talk to a tax professional if you are unsure whether you need to make quarterly payments.

State and local taxes on real estate sales

In addition to federal capital gains tax, many states tax capital gains. Some states tax all capital gains at the same rate as ordinary income. Others have a separate capital gains tax that applies only to gains above a certain threshold — for example, Washington State taxes long-term capital gains over $250,000 at 7%. A few states, including Florida, Texas, and Wyoming, do not have a state income tax at all.

Some cities and counties also impose transfer taxes or sales taxes on real estate transactions. These are separate from capital gains tax and are usually paid at closing by the seller or split between buyer and seller. The rules vary widely by location, so check with your local assessor or a tax professional in your state.

Deductions and losses related to the sale

You cannot deduct the cost of selling the property — such as real estate agent commissions, title insurance, or closing costs — from your capital gain. These costs are already factored into your cost basis calculation. However, if you sold the property at a loss, you generally cannot deduct that loss on your personal tax return, because the IRS does not allow losses on personal residences.

If you sold a rental property or investment land at a loss, you can deduct the loss against other capital gains you had 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.

Frequently Asked Questions

Do I have to pay capital gains tax if I sold my house and lived there the whole time?

Not on the gain, if you meet the primary residence test. You must have owned and lived in the house for at least two of the last five years. If you do, you can exclude $250,000 (single) or $500,000 (married filing jointly) of the gain. Any gain above that limit is taxable.

What if I inherited a house and sold it a few months later?

You likely owe little or no capital gains tax. When you inherit property, your cost basis is stepped up to the fair market value on the date of death. If you sell shortly after, your gain is the difference between that stepped-up value and the sale price, which is usually small. This applies whether or not you lived in the house.

Can I deduct real estate agent commissions from my capital gain?

No, not directly. However, commissions and other selling costs reduce the net proceeds you receive, which affects your overall financial outcome. For tax purposes, these costs are already reflected in your cost basis, so they are factored into your gain calculation.

What if I sold a rental property — do I get the primary residence exclusion?

No. The exclusion applies only to your primary residence. Rental properties, vacation homes, and investment land are taxed on the full gain at long-term or short-term rates, depending on how long you owned them. If you rented out a property that was once your home, you may owe tax on part of the gain.

Do I report the sale if I broke even or sold at a loss?

You must still file Schedule D to report the sale, even if there is no gain. If you sold a personal residence at a loss, you cannot deduct it. If you sold a rental property or investment property at a loss, you can use it to offset other capital gains or up to $3,000 of ordinary income per year.