You pay capital gains tax when you sell real estate for more than you paid for it, but only on the profit — and only if you don't meet an exception

Capital gains tax is owed on the difference between what you paid for a property and what you sold it for. If you bought a house for $300,000 and sold it for $400,000, your gain is $100,000. That $100,000 is what gets taxed, not the full sale price. The tax is due in the year you close the sale, reported on your federal income tax return.

The timing of when you actually owe the tax depends on whether your gain is short-term (you owned it less than a year) or long-term (you owned it a year or more). Long-term gains are taxed at lower rates. You report the sale on Form 8949 and Schedule D when you file your taxes, usually by April 15 of the following year.

Many homeowners owe nothing because of the primary residence exclusion: if you lived in the house as your main home for at least two of the last five years, you can exclude up to $250,000 of gain if you're single, or $500,000 if you're married filing jointly. This exclusion is the reason most people who sell a home they've lived in pay no capital gains tax at all.

Key Takeaways

  • Capital gains tax applies only to profit (sale price minus what you paid), not to the full sale amount.
  • If you lived in the house as your primary home for at least two of the last five years, you can exclude up to $250,000 (single) or $500,000 (married) of the gain from tax.
  • Long-term gains (property owned over one year) are taxed at lower federal rates than short-term gains.
  • You report the sale on Form 8949 and Schedule D with your tax return in the year you close the sale.
  • State capital gains taxes vary; some states have no capital gains tax, while others tax real estate gains differently than stock gains.

Short-Term vs. Long-Term Gains: The One-Year Rule

If you owned the property for one year or less before selling, your gain is short-term capital gain. Short-term gains are taxed as ordinary income at your regular tax bracket rate, which can be as high as 37% at the federal level. This applies whether you bought it as an investment or lived in it.

If you owned it for more than one year, your gain is long-term capital gain. Long-term rates are lower: 0%, 15%, or 20% depending on your total income for the year. Most people fall into the 15% bracket. This is a significant difference — a $100,000 gain taxed as short-term at 37% costs $37,000; the same gain as long-term at 15% costs $15,000.

The one-year clock starts the day you take ownership. If you close on March 15 and sell on March 14 of the next year, it counts as long-term. If you sell on March 15, it's short-term.

The Primary Residence Exclusion: Who Gets It and How Much

The primary residence exclusion is the biggest tax break for real estate. If you owned and lived in the house as your main home for at least two of the five years before you sold it, you can exclude $250,000 of gain from tax if you're single, or $500,000 if you're married filing jointly. You can use this exclusion only once every two years.

The two years do not have to be consecutive. If you lived there for one year, moved out for two years, then sold it, you still may have access to. The IRS looks at the two-year period immediately before the sale.

This exclusion applies even if your gain is short-term. A single person who bought a house for $200,000, lived in it for eight months, and sold it for $350,000 has a $150,000 gain. Because they lived there as their primary home, they exclude the full $150,000 and owe no capital gains tax, even though the gain is short-term.

If your gain exceeds the exclusion limit, you pay tax only on the excess. A married couple with a $600,000 gain excludes $500,000 and pays tax on $100,000.

Investment Properties and Rental Homes: No Exclusion

If you never lived in the property — it was always a rental or investment property — you cannot use the primary residence exclusion. You owe capital gains tax on the entire profit, at long-term or short-term rates depending on how long you owned it.

Rental properties have an additional layer: depreciation recapture. If you claimed depreciation deductions on your tax returns while renting the property, you must "recapture" (pay back) tax on that depreciation when you sell. Depreciation recapture is taxed at 25%, separate from your capital gains rate. This applies even if your overall gain is small or you sold at a loss.

Example: You bought a rental house for $300,000, claimed $50,000 in depreciation over ten years, and sold it for $400,000. Your capital gain is $100,000. You owe long-term capital gains tax on the $100,000 (likely 15%), plus 25% recapture tax on the $50,000 in depreciation you claimed. The recapture tax is $12,500, separate from the capital gains tax.

State Capital Gains Taxes and How They Differ

Federal capital gains tax is only part of the bill. Most states also tax capital gains, though the rules vary widely. Nine states have no income tax at all and therefore no capital gains tax: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (which taxes only dividends and interest, not capital gains).

In states that do tax capital gains, the rate usually matches your ordinary income tax rate. Some states tax long-term gains at a lower rate than short-term gains, but not all. A few states — California, New Jersey, and New York — have separate, higher tax brackets for high earners that can push capital gains rates above 10%.

If you sell a property in one state but live in another, you may owe tax to both. The state where the property is located usually has the primary claim. You can often claim a credit on your home state return for taxes paid to the other state, but the rules are complex and depend on your specific situation.

How to Calculate Your Gain: Cost Basis and Adjusted Basis

Your cost basis is what you paid for the property, including the purchase price, closing costs, and certain improvements. It is not what you paid in mortgage payments or property taxes. If you bought a house for $300,000 and paid $5,000 in closing costs, your basis is $305,000.

Your adjusted basis is your cost basis plus the cost of capital improvements (major repairs or upgrades that add value or extend the life of the property) minus depreciation you claimed. Painting, routine repairs, and maintenance do not count as capital improvements. A new roof, addition, or major renovation does.

Your gain is the sale price minus your adjusted basis. If you sold for $400,000 and your adjusted basis is $305,000, your gain is $95,000. Keep all receipts and closing documents — the IRS may ask for proof of your basis years later.

Reporting the Sale on Your Tax Return

You report real estate sales on Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses). Form 8949 lists each property sold, the date acquired, the date sold, the sale price, your basis, and your gain or loss. Schedule D summarizes your short-term and long-term gains and losses and calculates your net gain.

You file these forms with your Form 1040 (your main tax return) by April 15 of the year following the sale. If you sold the property in 2024, you report it on your 2024 tax return, due April 15, 2025.

If you used a real estate agent, they will send you a Form 1099-S showing the sale price. This does not report your basis or gain — that is your responsibility. The IRS receives a copy of the 1099-S, so they know you sold the property. If you don't report the sale on your return, the IRS will notice the mismatch.

If your gain qualifies for the primary residence exclusion, you still report the sale on Form 8949 and Schedule D. You calculate the full gain, then note on the form that it is excluded. You do not owe tax, but you must report it.

Frequently Asked Questions

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

No. If you sell for less than your basis, you have a loss, not a gain. You do not owe capital gains tax. You can use the loss to offset other capital gains you had that year. If your losses exceed your gains, you can deduct up to $3,000 of the excess loss against ordinary income, and carry forward any remaining loss to future years.

What if I inherited the property — does that change the tax?

Yes. When you inherit property, your basis is "stepped up" to the fair market value on the date of death. If your parent bought a house for $100,000 and it was worth $400,000 when they died, your basis is $400,000. If you sell it immediately for $400,000, you have no gain and owe no tax. This is a major tax benefit of inheritance.

Can I avoid capital gains tax by doing a 1031 exchange?

A 1031 exchange lets you sell one investment property and buy another without paying capital gains tax on the sale, as long as you follow strict rules: you must identify the replacement property within 45 days and close within 180 days, and the replacement must be of equal or greater value. This defers the tax, not eliminates it. When you eventually sell the replacement property without doing another exchange, you owe tax on the combined gain.

If I sell a vacation home I don't live in full-time, can I use the primary residence exclusion?

Only if you lived there as your main home for at least two of the five years before the sale. A vacation home you visit occasionally does not may have access to. If you rented it out part of the year, you can still may have access to if you lived there as your primary residence for the required time, but the calculation becomes complex and may reduce your exclusion.

Do I have to pay capital gains tax the year I sell, or can I defer it?

You owe the tax in the year you close the sale, reported on your tax return due the following April 15. You cannot defer it to a later year unless you do a 1031 exchange (for investment property only). The tax is due even if you have not received all the sale proceeds yet — for example, if the buyer is paying you over time.