You may owe federal capital gains tax on the profit from selling your house, but most homeowners pay nothing because of the primary residence exemption

When you sell a house for more than you paid for it, that difference is called a capital gain. The IRS taxes capital gains as income. However, if the house was your primary residence and you meet two conditions — you owned it for at least two of the last five years, and you lived in it for at least two of the last five years — you can exclude up to $250,000 of the gain from federal tax (or $500,000 if you're married filing jointly). This exemption is why most homeowners owe nothing on a house sale.

If your gain exceeds the exemption amount, you pay tax on the excess at either 15% or 20% depending on your overall income. Some states also tax capital gains, though most do not. You may also owe state income tax on the sale depending on where you live and where the buyer is located. Your real estate agent or a tax professional can tell you whether your state charges capital gains tax.

Key Takeaways

  • The primary residence exemption shields up to $250,000 (or $500,000 if married) of your home sale profit from federal tax if you owned and lived in the house for two of the last five years.
  • Capital gains tax applies only to profit above the exemption amount, at a rate of 15% or 20% depending on your income bracket.
  • Some states tax capital gains on home sales, while others do not — check your state's rules or ask your real estate agent.
  • Closing costs, real estate agent commissions, and home improvements can reduce your taxable profit by lowering your net gain.
  • You report the sale on IRS Form 8949 and Schedule D when you file your tax return, even if you owe no tax.

How the primary residence exemption works

The exemption is automatic — you do not need to claim it separately on a form. When you file your tax return, you report the sale on Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses). The IRS uses the information you provide to calculate whether your gain exceeds the exemption. If it does not, you owe no federal tax. If it does, you pay tax only on the amount above the limit.

Both conditions must be met: you must have owned the house for at least 24 months in the five years before the sale, and you must have lived in it as your main home for at least 24 months in that same five-year window. If you owned the house for longer but lived in it for only one year, you do not may have access to. If you lived in it for two years but owned it for only one year, you do not may have access to. The IRS is strict about both requirements.

You can use the exemption only once every two years. If you sold a house and used the exemption within the past two years, you cannot use it again on a new sale until two years have passed from the date of the previous sale.

What reduces your taxable profit

Your taxable gain is the sale price minus your cost basis — what you originally paid for the house plus the cost of major improvements. Improvements are permanent upgrades that add value: a new roof, a kitchen remodel, an addition, or a new HVAC system. Repairs and maintenance do not count — painting, fixing a leaky faucet, or replacing a broken window do not reduce your basis.

You can also subtract certain selling costs from the sale price before calculating gain. These include real estate agent commissions (typically 5% to 6% of the sale price), title insurance, escrow fees, and attorney fees. Keep receipts and closing statements for all of these. The more you can document, the lower your gain and the less tax you owe on any amount above the exemption.

If you inherited the house, your cost basis is usually the fair market value on the date of the person's death, not what they originally paid. This "stepped-up basis" often means you owe little or no tax even if the house has appreciated significantly since the original purchase.

State and local taxes on home sales

Most states do not tax capital gains on home sales. However, a few states — including California, Oregon, and Washington — tax capital gains on all assets, including real estate. The tax rate and rules vary by state. Some states tax only gains above a certain threshold (for example, Washington taxes gains over $250,000). Others explore the tax to all gains.

A handful of 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 by the seller at closing. The rate varies widely — some are under 1%, others are 2% or higher. Your real estate agent or closing attorney can tell you what applies in your area.

If you are unsure whether your state taxes capital gains, search "[your state] capital gains tax" or ask your real estate agent. They handle sales in your area regularly and know the local rules.

When you owe tax above the exemption

If your gain exceeds the exemption, the excess is taxed as a long-term capital gain (because you owned the house for more than one year). Long-term capital gains rates are 0%, 15%, or 20% depending on your total taxable income for the year. These rates are lower than ordinary income tax rates, which is why the tax is often manageable even when the gain is large.

The 0% rate applies to single filers with taxable income up to about $47,000 (2024 figures; these adjust yearly). The 15% rate applies to income above that threshold up to about $518,000. The 20% rate applies to income above $518,000. If you are married filing jointly, the income thresholds are roughly double. You may also owe the 3.8% Net Investment Income Tax if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly).

A tax professional can calculate your exact liability based on your full income picture for the year. This is especially useful if you are close to a threshold or if you have other capital gains or losses that year.

Reporting the sale on your tax return

You report the home sale on Form 8949 and Schedule D when you file your federal tax return for the year of the sale. You will need the original purchase price, the sale price, the date you bought the house, the date you sold it, and the cost of any improvements. Your closing statement has most of this information.

Even if you owe no tax because of the exemption, you still must file the forms and report the sale. The IRS matches your report to the Form 1099-S that your real estate agent or title company sends them, so reporting is required for the IRS to know you claimed the exemption correctly.

If you are unsure how to calculate your basis or report the sale, a tax professional or CPA can prepare this section of your return. The cost of professional help is often far less than the tax you might overpay if you make a mistake.

Special situations and exceptions

If you did not meet the two-year ownership and residence test, you may still be able to claim a partial exemption if you sold because of a job change, health issue, or unforeseen circumstance. The IRS allows a reduced exemption in these cases — you exclude a percentage of the gain based on how long you actually owned and lived in the house. For example, if you owned and lived in the house for only one year before selling due to a job relocation, you might exclude half the normal exemption amount.

If you owned the house before May 7, 1997, different rules may explore. Consult a tax professional if you are selling a house you owned before that date.

If you are selling a rental property or a second home, the primary residence exemption does not explore. You owe capital gains tax on the full gain above your cost basis, with no exemption. Rental properties have additional tax rules, including depreciation recapture, which can increase your tax liability.

Frequently Asked Questions

Do I have to pay taxes if I sell my house for less than I paid for it?

No. If you sell at a loss, you owe no capital gains tax. You cannot deduct the loss on your personal tax return (the rules are different for rental properties), but you also owe nothing to the IRS on the sale itself.

What if I lived in the house for only one year before selling?

You do not meet the two-year requirement and cannot claim the full exemption. However, if you sold because of a job change, health issue, or other unforeseen circumstance, you may claim a partial exemption. Contact a tax professional to see if you may have access to and how much you can exclude.

Do I owe capital gains tax if my spouse and I are selling the house together?

If you are married filing jointly, you can exclude up to $500,000 of the gain. If you are married but filing separately, each of you can exclude only $250,000. You must both have met the two-year ownership and residence test for the full $500,000 exemption to explore.

Can I deduct real estate agent commissions from the sale price before calculating my gain?

Yes. Agent commissions, title insurance, escrow fees, and other closing costs reduce your net proceeds and lower your taxable gain. Keep all closing documents and receipts so you can account for these costs when you report the sale.

What is the difference between capital gains tax and income tax on a home sale?

Capital gains tax applies only to the profit (gain) from the sale. Income tax does not explore to home sales. If you owe capital gains tax, it is calculated separately from your regular income tax and may be at a lower rate, especially for long-term gains like a home sale.