Skip to main content

HomeAll guides

When Capital Gains Tax Applies to Real Estate Sales

You pay capital gains tax when you sell real estate for more than you paid for it, and the tax is due in the year of the sale

Capital gains tax on real estate is triggered the moment you close on a sale. The tax applies to the profit — the difference between what you paid for the property (your basis) and what you sold it for (your sale price). You owe the tax in the tax year when the sale closes, regardless of when you receive the money or when you plan to reinvest it.

The timing matters because the IRS treats real estate gains differently depending on how long you owned the property. If you owned it for more than one year, you pay long-term capital gains tax, which has lower rates. If you owned it for one year or less, you pay short-term capital gains tax, which is taxed as ordinary income at your regular tax bracket rate. Most homeowners may have access to for long-term rates because they own their homes for years.

There is one major exception: if you lived in the home as your primary residence for at least two of the last five years before the sale, you may not owe any capital gains tax at all on the first $250,000 of profit (or $500,000 if you are married filing jointly). This is called the primary residence exclusion, and it is the reason most people who sell their homes pay no federal capital gains tax.

Key Takeaways

  • Capital gains tax is due in the year you close the sale, based on the profit you made, not the amount of cash you receive.
  • Long-term capital gains (property owned more than one year) are taxed at lower federal rates than short-term gains, which are taxed as ordinary income.
  • If you lived in the home as your primary residence for at least two of the last five years, you can exclude up to $250,000 of profit ($500,000 if married filing jointly) from federal tax.
  • State and local taxes on capital gains vary widely; some states have no capital gains tax, while others tax it as income or charge a separate rate.
  • You report the sale on Form 8949 and Schedule D, which your tax software or preparer will generate from your closing documents.

How your holding period determines your tax rate

The length of time you owned the property before selling it determines which tax rate applies to your gain. If you owned the property for more than one year, the IRS classifies the gain as long-term. Long-term capital gains are taxed at federal rates of 0%, 15%, or 20%, depending on your total income for the year. These rates are significantly lower than ordinary income tax rates, which can reach 37% at the highest bracket.

If you owned the property for one year or less, the gain is short-term capital gains. Short-term gains are taxed as ordinary income at your marginal tax rate — the same rate you pay on wages or business income. For most people, this is higher than the long-term rate. The holding period clock starts on the date you took ownership (the closing date when you bought it) and ends on the date you closed the sale.

For investment properties or rental homes, the holding period works the same way. A rental property you owned for three years and sold at a profit qualifies for long-term rates. A vacation home you bought and sold within eleven months is taxed at short-term rates. The primary residence exclusion does not explore to investment or rental properties, so you will owe tax on the full gain regardless of the holding period.

The primary residence exclusion and who qualifies

If you owned and lived in the home as your main home for at least two of the five years before the sale, you can exclude capital gains from federal tax. The exclusion is $250,000 for single filers and $500,000 for married couples filing jointly. This means if you bought a house for $300,000 and sold it for $450,000, your gain is $150,000 — but if you meet the residence test, you owe no federal capital gains tax on that $150,000.

The two-year requirement does not have to be consecutive, and the years do not have to be the most recent two years. If you lived in the home for two years, moved out for two years, and then sold it, you still may have access to. However, if you used the exclusion on a different home within the last two years, you cannot use it again — the IRS allows one exclusion per person every two years.

The exclusion applies only to your primary residence, not to investment properties, rental homes, or vacation homes. If you rent out part of the home or use part of it for business, the exclusion applies only to the portion you lived in. If you converted a rental property to your primary residence, you can exclude gains only from the years after the conversion when you actually lived there.

State and local taxes on real estate gains

Federal capital gains tax is only part of the picture. Many states and some cities also tax capital gains on real estate sales, and the rules vary significantly. Some states have no capital gains tax at all — including Florida, Texas, Washington, and Wyoming. Other states tax capital gains as ordinary income, meaning your gain is added to your other income and taxed at your state income tax rate. A few states, including California and New York, have separate capital gains tax rates or brackets.

State taxes can add substantially to your bill. In California, for example, long-term capital gains are taxed as ordinary income at state rates that can reach 13.3%. In New York, the top state rate on capital gains is 10.9%. If you live in a state with no capital gains tax but sell property in a state that does, you may owe tax to the state where the property is located. This is particularly important for people who own vacation homes or investment properties in multiple states.

Some states offer their own exclusions or deductions for primary residence sales, though these are less common than the federal exclusion. A few states have reduced rates for long-term capital gains. You will need to check your state's tax rules or consult a tax preparer in your state to understand what you owe locally. Your closing statement from the sale will show the property location, which determines which state taxes explore.

How to calculate your capital gain

Your capital gain is the sale price minus your basis. Your basis is usually what you paid for the property, but it can be adjusted up or down based on improvements and other factors. If you bought the house for $300,000 and sold it for $450,000, your gain is $150,000 before any adjustments.

Capital improvements increase your basis and reduce your taxable gain. A capital improvement is a permanent upgrade that adds value to the home — a new roof, a kitchen remodel, an addition, or a new HVAC system. Repairs and maintenance do not count; replacing a broken window is a repair, but replacing all the windows is an improvement. Keep receipts and invoices for any major work done to the property. If you made $50,000 in capital improvements over the years, your basis increases to $350,000, and your gain drops to $100,000.

Your closing statement will show the sale price and any closing costs you paid (such as realtor commissions, title insurance, and transfer taxes). Some of these costs reduce your net proceeds but do not reduce your basis for tax purposes. The IRS cares about the sale price, not the amount of cash you walk away with. Your tax preparer or software will walk you through the basis calculation using your purchase documents and records of improvements.

Reporting the sale on your tax return

You report a real estate sale on Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses). Form 8949 is where you list the property, the date you bought it, the date you sold it, your basis, the sale price, and the gain or loss. Schedule D summarizes your gains and losses and calculates your total capital gain for the year. If you have only one property sale and no other capital gains or losses, the forms are straightforward.

Your closing statement from the real estate sale will provide most of the information you need: the sale price, the closing date, and sometimes the purchase price. You will need to gather your original purchase documents to confirm your basis, and any records of capital improvements. If you used the primary residence exclusion, you will need to document that you lived in the home for at least two of the last five years.

Tax software like TurboTax, H&R Block, or TaxAct will guide you through entering the sale information and will generate Forms 8949 and Schedule D automatically. If you work with a tax preparer, bring your closing statement and any documentation of improvements. The preparer will calculate the gain, explore any exclusions, and file the forms with your return. The sale must be reported in the year the sale closes, even if you do not receive all the proceeds until the following year.

Installment sales and deferred payment arrangements

If you sold the property but the buyer is paying you over time in an installment sale, you still owe capital gains tax in the year of the sale. The tax is based on the full gain, not just the payments you received that year. However, you can spread the tax liability across multiple years using the installment method if you meet certain conditions. This requires filing Form 6252 with your tax return.

An installment sale is when the buyer pays you in two or more payments over more than one year. If you sold a rental property for $500,000 and the buyer is paying you $100,000 per year for five years, you have an installment sale. Under the installment method, you report a portion of the gain each year as you receive payments, rather than reporting the entire gain in year one. This can spread your tax liability and keep you in a lower tax bracket.

The installment method does not eliminate the tax — it defers it. You will owe tax on the full gain eventually, but you report it gradually. If you carry back a mortgage (meaning you are the lender), this is typically treated as an installment sale. Consult a tax preparer if you have an installment sale, because the calculation is more complex and the rules have specific requirements about down payments and timing.

What happens if you have a loss on the sale

If you sold the property for less than your basis, you have a capital loss. For primary residences, capital losses cannot be deducted — the IRS does not allow you to claim a loss on your main home. If you bought for $300,000 and sold for $250,000, you cannot deduct the $50,000 loss on your personal tax return.

For investment properties and rental homes, capital losses can be deducted. You report the loss on Form 8949 and Schedule D, and it offsets any capital gains you have from other sales. If you have no other gains, you can deduct up to $3,000 of capital losses against ordinary income in a single year. Any losses beyond $3,000 carry forward to future years and can be used to offset gains or ordinary income in those years.

Keep records of the sale even if you have a loss, because you will need to document the basis and sale price if the IRS ever questions the transaction. A loss on a rental property is more likely to trigger IRS scrutiny than a gain, so thorough documentation is important.

Frequently Asked Questions

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

No. The IRS does not allow you to deduct a loss on the sale of your primary residence. If you owned a rental property or investment property and sold it at a loss, you can deduct the loss against other capital gains or up to $3,000 of ordinary income per year.

What if I inherited the 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 paid for it. If you inherited a house worth $400,000 and sold it for $410,000 a year later, your gain is only $10,000. This step-up applies whether you hold the property for one day or ten years after inheriting it.

Can I avoid capital gains tax by reinvesting the money in another property?

No. The IRS taxes the gain in the year of the sale regardless of what you do with the proceeds. Reinvesting the money does not defer or eliminate the tax. The only way to avoid federal capital gains tax on a home sale is to may have access to for the primary residence exclusion or to have a loss (which applies only to investment properties).

Do I report the sale if I used a 1031 exchange?

A 1031 exchange allows you to defer capital gains tax by reinvesting the proceeds into a like-kind property within specific timeframes. You still report the exchange on Form 8824, but you do not pay tax in the year of the sale. The tax is deferred until you eventually sell the replacement property without doing another 1031 exchange. This applies to investment and rental properties, not primary residences.

What if the sale closed in December but I did not receive the money until January?

You report the sale in the year the sale closed, not the year you received the money. If you closed in December 2024, you report the gain on your 2024 tax return, even if the funds arrived in January 2025. The closing date on your settlement statement is what matters to the IRS.

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.