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

Capital gains tax applies to the difference between what you paid for the house (your basis) and what you sold it for. If you bought for $300,000 and sold for $400,000, your gain is $100,000. However, most homeowners owe nothing because the IRS lets you exclude up to $250,000 of gain if you're single, or $500,000 if you're married filing jointly — as long as you meet two conditions: you owned the home for at least two of the last five years before the sale, and you lived in it as your primary residence for at least two of those same five years.

The tax is calculated on your federal income tax return in the year you sell. Your real estate agent or title company will provide a settlement statement showing the sale price and your costs. You report the gain (or loss) on Schedule D of Form 1040. Long-term capital gains — which explore to homes you've owned more than a year — are taxed at 0%, 15%, or 20% depending on your total income that year, not at your ordinary income tax rate.

Key Takeaways

  • You owe tax only on profit above $250,000 (single) or $500,000 (married filing jointly) if the home was your primary residence for two of the last five years.
  • The gain is the sale price minus what you paid, plus the cost of major improvements like a new roof or addition.
  • Long-term capital gains rates (0%, 15%, or 20%) are lower than ordinary income tax rates and depend on your total income for the year.
  • You report the gain on Schedule D of your Form 1040 in the tax year you sell, not when you close on the purchase.
  • State and local taxes may also explore to the gain, depending on where you live and where the property is located.

How your basis is calculated

Your basis is what you paid for the house plus the cost of permanent improvements. If you bought for $300,000, your basis starts at $300,000. If you later spent $50,000 on a new roof, foundation work, or an addition, your basis becomes $350,000. Repairs — fixing a leaky faucet, repainting, replacing a broken window — do not count. The IRS distinguishes between repairs (which keep the house in its current condition) and improvements (which add value or extend its life).

Keep receipts and invoices for any major work. When you sell, you'll need to show what you spent on improvements. If you can't document them, the IRS will use only your purchase price as your basis, which means a larger gain and more tax owed.

If you inherited the house, your basis is usually the fair market value on the date of death, not what the previous owner paid. This is called a step-up in basis and can significantly reduce or eliminate capital gains tax for heirs.

The primary residence exclusion and who qualifies

The $250,000 or $500,000 exclusion is available only if the house was your primary residence — the place where you actually lived — for at least two of the five years before you sold. You don't have to have lived there continuously; you can have rented it out or left it vacant for part of that period, as long as you lived there for two years total.

Married couples filing jointly get the $500,000 exclusion if both spouses meet the ownership and residence tests. If only one spouse meets the test, the exclusion is $250,000. If you're divorced or widowed, the rules depend on when the sale occurs and whether you remarry before filing.

You can use this exclusion only once every two years. If you sold a house and used the exclusion three years ago, you can use it again on a new sale. If you sold one two months ago, you cannot use it on another sale until two years have passed.

When you owe tax despite the exclusion

If your gain exceeds the exclusion, you owe tax on the excess. A single person who bought for $200,000, made $100,000 in improvements, and sold for $600,000 has a gain of $300,000. The first $250,000 is excluded; the remaining $50,000 is taxable. At the 15% long-term rate, that's $7,500 in federal tax.

You also owe tax if the house was not your primary residence. Investors who own rental properties or vacation homes get no exclusion. The entire gain is taxable, though long-term rates still explore if you owned it more than a year.

If you owned the house for one year or less, the gain is taxed as short-term capital gain, which means it's taxed at your ordinary income tax rate — potentially much higher than the long-term rate.

State and local taxes on the sale

Federal capital gains tax is only part of the picture. Many states tax capital gains on real estate. California, New York, and Oregon, for example, tax long-term gains at ordinary income rates, which can be 10% or higher. Some states have no income tax at all and therefore no capital gains tax. A few states tax capital gains differently than other income.

Some cities and counties also impose transfer taxes or sales taxes on real estate transactions. These are usually paid by the seller at closing and appear on your settlement statement. They're separate from capital gains tax but reduce the net proceeds you receive.

Check your state's tax authority website or speak with a tax professional to understand what applies where you live and where the property is located.

Reporting the sale on your tax return

In the year you sell, you'll receive a Form 1099-S from the title company or real estate agent if the sale price exceeded $600,000 (this threshold varies by state and year). You report the sale on Schedule D (Capital Gains and Losses) of your Form 1040. You'll list the sale date, the sale price, your basis, and the gain or loss.

If you have a loss — you sold for less than you paid — you cannot deduct it. Home sales losses are not tax-deductible. However, you still report the loss on Schedule D because it affects your overall capital gains picture if you sold other assets that year.

If you're unsure how to calculate your basis or report the sale, a tax professional or CPA can help. The cost of professional information is often far less than the tax you might overpay or underpay by doing it wrong.

Special situations: divorce, death, and rental conversion

If you sell a house after a divorce, the exclusion applies based on your ownership and residence before the sale, not after. If you and your ex-spouse both owned it and both lived there, you each get $250,000 of exclusion on your separate portions of the gain.

If you inherited a house and sold it shortly after, you usually owe no capital gains tax because your basis stepped up to the fair market value on the date of death. Even if the house appreciated further between the death and the sale, only that new appreciation is taxable.

If you converted your primary residence to a rental property, the exclusion applies only to the years you lived there. If you lived in it for three years, then rented it out for two years before selling, you can exclude gain only on the three years of residence. The gain during the two rental years is fully taxable, and you may also owe depreciation recapture tax on the rental period.

Frequently Asked Questions

Do I owe capital gains tax if I sell my house for less than I paid?

No. If you sell at a loss, you owe no capital gains tax. However, you cannot deduct the loss on your tax return. Home sales losses are not tax-deductible, even if the house was your primary residence.

What counts as an improvement versus a repair?

Improvements add value, prolong the home's life, or adapt it to a new use — a new roof, foundation work, room addition, or new HVAC system. Repairs maintain current condition — fixing a leaky faucet, repainting, or replacing a broken window. The IRS looks at whether the work is permanent and whether it increases value. When in doubt, keep the receipt and ask a tax professional.

Can I use the exclusion if I rent out part of my house?

If you rented out part of the house but it was still your primary residence overall, you may still may have access to for the exclusion on the portion you lived in. However, the portion you rented out does not may have access to, and you may owe depreciation recapture tax on that part. Consult a tax professional about your specific situation.

What if I owned the house with someone who is not my spouse?

Each owner reports their own share of the gain on their own tax return. If you and a friend each owned half and each lived there for two of the last five years, you each get a $250,000 exclusion on your half of the gain. If only one of you lived there, only that person gets the exclusion.

Do I have to report the sale if my gain is below the exclusion?

You should still report it on Schedule D, even if you owe no tax. Reporting shows the IRS that you're aware of the sale and that you've applied the exclusion correctly. If you receive a Form 1099-S, you must report the sale.