You may owe capital gains tax on a house sale, but most homeowners don't
Whether you pay capital gains tax on a house sale depends on how much profit you made and whether you lived in the house as your primary home. If you owned and lived in the house for at least two of the last five years before you sold it, the IRS lets you exclude up to $250,000 of profit from taxation if you're single, or $500,000 if you're married filing jointly. That exclusion means most people who sell a home they've lived in walk away owing nothing to the IRS, even if they made a substantial profit.
If you didn't live in the house as your primary home—for example, you're selling a rental property or a vacation home—you owe capital gains tax on the entire profit, with no exclusion. The tax rate depends on how long you owned the property and your income level, but it ranges from 15% to 20% for most people, plus potentially a 3.8% net investment income tax if your income is above certain thresholds.
Key Takeaways
- You can exclude up to $250,000 (single) or $500,000 (married) of profit from capital gains tax if you owned and lived in the house for at least two of the last five years before selling.
- Capital gains tax applies only to profit—the sale price minus what you paid for the house, plus the cost of major improvements you made.
- If you didn't live in the house as your primary home, you owe capital gains tax on all profit with no exclusion, at rates of 15% to 20% depending on your income.
- You report the sale on Form 8949 and Schedule D when you file your tax return, not when you close on the house.
How the primary residence exclusion works
The IRS primary residence exclusion is the main reason most home sellers don't pay capital gains tax. To use it, you must have owned the house and lived in it as your main home for at least two of the five years before you sold it. Those two years don't have to be consecutive, and you can have rented it out for part of that time—what matters is that you lived there as your primary residence for the may have access to period.
If you meet those conditions, you can exclude $250,000 of profit if you're single, or $500,000 if you're married and file jointly. Your spouse must also meet the ownership and use test for you to claim the full $500,000 exclusion. If only one spouse meets the test, you can each exclude $250,000.
The exclusion applies to the profit only, not the sale price. If you bought the house for $300,000, made $50,000 in improvements, and sold it for $600,000, your profit is $250,000 ($600,000 minus $300,000 minus $50,000). Since that profit is under the $250,000 limit for a single filer, you owe no capital gains tax.
What counts as your profit on the sale
Your profit is the sale price minus what you originally paid for the house, minus the cost of major improvements you made. The IRS calls this your adjusted basis. Repairs and maintenance don't count—replacing a roof or fixing a foundation doesn't reduce your basis. But improvements that add value or extend the life of the house do: a new kitchen, a deck, a room addition, or a new HVAC system all count.
You also subtract the cost of selling: real estate agent commissions, title insurance, attorney fees, and transfer taxes all reduce your profit. Keep receipts and closing documents for anything you claim as an improvement or selling cost.
Example: You bought a house for $200,000. You spent $30,000 on a kitchen renovation and $5,000 on a new roof. You paid $12,000 in real estate commissions and closing costs when you sold it for $350,000. Your adjusted basis is $200,000 plus $30,000 (the kitchen counts; the roof is maintenance) minus $12,000 in selling costs, which equals $218,000. Your profit is $350,000 minus $218,000, or $132,000. As a single filer, you exclude all $132,000, so you owe no capital gains tax.
Capital gains tax on rental properties and second homes
If you sell a house you never lived in as your primary home—a rental property, a vacation home, or an investment property—you owe capital gains tax on the entire profit with no exclusion. The tax rate depends on how long you owned it and your income level. If you owned it for more than one year, you pay long-term capital gains tax, which is 0%, 15%, or 20% depending on your taxable income. 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 rate.
You may also owe a 3.8% net investment income tax if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). This tax applies to investment income, including capital gains.
If you converted a primary residence to a rental property, the rules are more complex. You can still use the primary residence exclusion for the years you lived there, but you owe capital gains tax on the profit from the years you rented it out. You'll need to calculate the profit for each period separately.
When you report the sale and how the IRS knows
You report the house sale on your tax return for the year you closed on the sale, not the year you listed it. The form you use is Form 8949 (Sales of Capital Assets), which feeds into Schedule D (Capital Gains and Losses). Both forms are part of your federal income tax return.
The title company or closing attorney sends a Form 1099-S to you and the IRS reporting the sale price. The IRS uses this form to cross-check your tax return. If you report a different sale price or don't report the sale at all, the IRS will notice the mismatch. You don't have to report the sale if you're using the primary residence exclusion and you owe no tax, but it's safer to report it anyway and claim the exclusion explicitly.
If you used part of the house as a home office or rented out a room, the calculation becomes more complicated. You may not be able to claim the full exclusion for the years you used part of it for business. A tax professional can help you sort this out.
Situations where you can't use the full exclusion
You can use the primary residence exclusion only once every two years. If you sold a house and used the exclusion within the last two years, you can't use it again on a new sale until two years have passed from the date of the previous sale.
You also lose the exclusion if you didn't own and live in the house for at least two of the five years before the sale. If you owned it for only 18 months, you don't may have access to. However, there are exceptions: if you sold because of a change in your job location, health problems, or unforeseen circumstances, the IRS may let you claim a reduced exclusion. You'd exclude a fraction of the $250,000 or $500,000 based on how long you actually owned and lived in the house.
If you inherited the house, you get a step-up in basis. This means your basis is the fair market value of the house on the date the previous owner died, not what they paid for it. If you sell it shortly after inheriting it, you may owe little or no capital gains tax even if the house was worth much more when the previous owner owned it.
State and local capital gains taxes
Some states tax capital gains on real estate sales in addition to federal tax. The states and rates vary: California taxes capital gains as ordinary income (up to 13.3%), New York has rates up to 10.9%, and Oregon up to 9.9%. Other states have no capital gains tax at all. A few states tax capital gains only on investments, not on real estate.
Check your state's tax authority website or speak with a tax professional to understand what you owe in your state. If you moved to a different state after selling the house, you may owe tax in the state where you lived when you sold it, not where you live now.
Frequently Asked Questions
Do I have to report the sale if I don't owe any tax?
You're not required to report it if you're using the primary residence exclusion and owe no federal tax. However, reporting it explicitly on Form 8949 and Schedule D is safer, because the IRS receives a Form 1099-S with the sale price and will notice if you don't report it. Reporting the sale and claiming the exclusion shows the IRS you know about the transaction and have a reason for not paying tax.
What if I sold the house at a loss?
You can't deduct a loss on the sale of your primary residence. If you sold it for less than you paid for it, you straightforward don't report the sale. If it was a rental property or investment property, you can deduct the loss against other capital gains or, in some cases, against ordinary income, up to $3,000 per year.
Do I owe capital gains tax if I inherited a house and then sold it?
Probably not. When you inherit a house, your basis is stepped up to its fair market value on the date of death. If you sell it soon after, your profit is the difference between the sale price and that stepped-up value, which is often small or zero. You would owe capital gains tax only if the house increased significantly in value between the date of death and the sale.
Can I use the primary residence exclusion if I'm going through a divorce?
Yes, but the rules depend on when you sell and who lived where. If you and your spouse sell the house while still married, you can each claim up to $250,000 of exclusion (or $500,000 together if you file jointly). If one spouse sells after the divorce, they can claim $250,000 if they owned and lived in the house for two of the last five years. Speak with a tax professional about your specific situation.
What if I rented out my house for a few years and then moved back in?
You can still use the primary residence exclusion for the years you lived there, but you owe capital gains tax on the profit from the years you rented it out. You'll need to calculate the profit for each period separately and may also owe depreciation recapture tax on the rental years. This is complex—work with a tax professional to get it right.