You owe capital gains tax when you sell real estate for more than you paid for it, but only on the profit — and only if that profit exceeds certain thresholds

The tax is due in the year you close the sale. You report it on your federal tax return filed the following spring (April 15 of the year after the sale). Most people who sell a primary home owe nothing, because the law lets you exclude up to $250,000 of profit if you're single, or $500,000 if you're married filing jointly — provided you meet two conditions: you owned the home for at least two of the five years before the sale, and you lived in it as your main home for at least two of those five years.

If your profit is below that threshold, you file normally and report zero capital gains tax. If your profit exceeds it, you owe federal tax on the amount over the limit. Some states also tax capital gains on real estate; others do not. The rate you pay depends on your total income for that year and your filing status.

Key Takeaways

  • Capital gains tax on a home sale is due when you file your tax return the year after you sell, not at closing.
  • Most people who sell a primary home owe no federal tax because the $250,000 (single) or $500,000 (married) exclusion covers their profit.
  • You must have owned and lived in the home as your main residence for at least two of the five years before the sale to use the exclusion.
  • If your profit exceeds the exclusion, the tax rate depends on your total income that year; federal rates range from 0% to 20% on the excess gain.
  • State capital gains taxes vary: some states have no tax, others tax real estate gains the same as other income, and a few have separate capital gains rates.

How the $250,000 or $500,000 exclusion works

The exclusion is automatic if you meet the ownership and use tests. You do not need to claim it separately or file extra forms — it simply reduces your taxable gain. If you bought your home for $300,000 and sold it for $650,000, your profit is $350,000. As a single filer, you subtract $250,000, leaving $100,000 in taxable gain. As a married couple filing jointly, you subtract $500,000, leaving zero taxable gain and no tax owed.

The two-year rule is flexible. You do not have to own and live in the home for the two years immediately before the sale. You can have owned it for two years total within the five-year window before the sale, even if you moved out years earlier. However, if you sell within two years of buying, or if you lived in the home for less than two of the past five years, you lose the exclusion entirely and owe tax on the full profit.

You can use the exclusion only once every two years. If you sold a home and used the exclusion in 2022, you cannot use it again until 2024, even if you buy and sell a different home in 2023.

What happens if your profit exceeds the exclusion

The excess profit is taxed as a long-term capital gain if you owned the home for more than one year. Long-term capital gains rates are lower than ordinary income rates and depend on your total taxable income for that year. For 2024, federal long-term capital gains rates are 0%, 15%, or 20%, depending on your income bracket and filing status. A single filer with taxable income up to $47,025 pays 0%; between $47,025 and $518,900 pays 15%; above $518,900 pays 20%.

These brackets change each year for inflation. If you owned the home for one year or less, the gain is taxed as short-term capital gain at your ordinary income tax rate, which is higher.

Example: You are married, sold your primary home for $800,000, and bought it for $400,000. Your profit is $400,000. You subtract the $500,000 exclusion, leaving zero taxable gain. You owe no federal capital gains tax. If instead you sold for $950,000, your profit would be $550,000, the exclusion would cover $500,000, and you would owe tax on $50,000 at the long-term capital gains rate that applies to your income bracket.

State capital gains taxes on real estate

Nine states have no income tax at all: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (which taxes only dividends and interest, not capital gains). If you live in one of these states, you owe no state capital gains tax on a home sale.

Most other states tax capital gains as ordinary income, meaning they apply their regular income tax rate to the gain. A few states — California, Hawaii, Illinois, Iowa, Maryland, Minnesota, Missouri, Montana, Nebraska, New Mexico, New York, North Carolina, Oregon, Rhode Island, Vermont, and Washington D.C. — have separate capital gains tax rates, usually higher than their ordinary income rates. California, for example, taxes long-term capital gains as ordinary income at rates up to 13.3%.

Your state tax is separate from federal tax and is calculated on the same gain. If you owe federal capital gains tax on $50,000, you may also owe state tax on that same $50,000. Some states offer their own exclusions or deferrals for primary home sales, but these vary widely and do not follow the federal $250,000/$500,000 rule.

When you report the gain on your tax return

You report the sale on Schedule D (Capital Gains and Losses) and Form 8949 (Sales of Capital Assets), which you attach to your Form 1040. You will receive a Form 1099-S from your title company or real estate agent if the sale price exceeded $600,000 (this threshold varies by state). The 1099-S reports the sale price, not the gain, so you still have to calculate the gain yourself using your purchase price and closing costs.

The tax return is due April 15 of the year following the sale. If you sold in 2024, you file the return in April 2025. You can request an extension to October 15, 2025, but taxes owed are still due by April 15 even if you extend the filing deadline.

If you owe capital gains tax, you can pay it with your return or in quarterly installments if you expect to owe more than $1,000. If you underpay, the IRS charges interest and penalties.

Special situations: inherited homes, investment properties, and multiple sales

If you inherited a home, you receive a "stepped-up basis" — the home's value is reset to its fair market value on the date of death. If you then sell it, your gain is calculated from that stepped-up value, not from what the original owner paid. This often means little or no gain and little or no tax, even if the home appreciated significantly after you inherited it.

Investment properties and rental homes do not may have access to for the $250,000/$500,000 exclusion. You owe capital gains tax on the full profit, minus depreciation recapture (a separate tax on the depreciation deductions you claimed while renting it out). The depreciation recapture rate is 25%, which is higher than the long-term capital gains rate.

If you sold a home and did not meet the two-year ownership or use test, you may still be able to claim a partial exclusion if you sold due to a change in employment, health, or unforeseen circumstances. The IRS allows a reduced exclusion in these cases, but you must file Form 8801 and meet specific criteria.

How to calculate your gain and what documents you need

Your gain is the sale price minus your adjusted basis. Your adjusted basis is what you paid for the home plus the cost of permanent improvements (a new roof, addition, or kitchen remodel), minus any casualty losses or insurance payouts. It does not include maintenance costs like painting or repairs.

Gather these documents: the original purchase deed or settlement statement showing what you paid, closing statements from the sale showing the sale price and closing costs, receipts or invoices for any major improvements, and records of any casualty losses. Your real estate agent or title company can provide the sale closing statement. Your original lender or title company can provide the purchase closing statement.

If you cannot find the original purchase price, you can use tax records, old mortgage documents, or a title search. The IRS does not require you to provide these documents with your return, but you must keep them for at least three years in case of an audit.

Frequently Asked Questions

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

No. You cannot deduct a loss on the sale of a primary home. If you bought for $400,000 and sold for $350,000, you owe no tax and cannot claim the $50,000 loss on your return. Investment properties are different — you can deduct losses on rental or investment real estate.

What if I owned the home for exactly two years — do I may have access to for the exclusion?

Yes. The rule is "at least two of the five years," so two years exactly meets the test. The two years do not have to be consecutive, and they do not have to end on the sale date — they just have to fall within the five-year window before the sale.

Can I use the exclusion if I'm divorced and selling a home I owned with my ex?

Yes, if you meet the ownership and use tests. Each person can exclude up to $250,000 of their share of the gain. If you and your ex each owned 50% and each lived in the home for two of the past five years, you each exclude $250,000 from your share of the profit. If only one of you lived there, only that person can use the exclusion.

Do I have to report the sale to the IRS even if I owe no tax?

You must file a return and report the sale on Schedule D if you received a Form 1099-S. If you did not receive a 1099-S (because the sale price was below $600,000 in your state), you still should report it to avoid questions later, though the IRS may not require it if your gain is zero or covered by the exclusion.

What if I sold my home in one state and moved to another — which state taxes the gain?

The state where the home is located taxes the gain, not the state where you live now. If you sold a home in California and moved to Texas, California taxes the gain (at its capital gains rate) even though you now live in a no-tax state. Some states offer credits for taxes paid to other states, but you should consult a tax professional if you sold property in a high-tax state.