What capital gains tax is and how it works on real estate
Capital gains tax is the tax you owe on the profit you make when you sell property for more than you paid for it. The profit itself — not the sale price — is what gets taxed. If you bought a house for $300,000 and sold it for $400,000, your gain is $100,000, and that $100,000 is what the IRS taxes, not the full $400,000.
The tax rate depends on how long you owned the property. If you held it for more than one year, you pay long-term capital gains tax, which is lower. If you sold it within one year, you pay short-term capital gains tax, which is taxed as ordinary income at your regular tax bracket. Most home sales may have access to for long-term rates because people typically own homes longer than a year.
The federal long-term capital gains rate is 0%, 15%, or 20%, depending on your income level. Your state may also tax capital gains. Some states have no capital gains tax on real estate; others tax it as income. You will need to know your state's rules to calculate your total tax bill.
Key Takeaways
- Your capital gain is the sale price minus your adjusted basis (what you paid plus improvements, minus depreciation if you rented it out).
- Long-term capital gains (property held over one year) are taxed at 0%, 15%, or 20% federally, depending on your total income for the year.
- You can exclude up to $250,000 of gain ($500,000 if married filing jointly) if you lived in the home as your primary residence for at least two of the last five years.
- State taxes on capital gains vary widely — some states charge nothing, others tax it as income, and a few have a separate capital gains tax.
- Closing costs, real estate agent fees, and home improvements reduce your gain and should be included in your calculation.
Calculate your adjusted basis (what you actually paid)
Your adjusted basis is not just the purchase price. It includes the price you paid plus any capital improvements you made, minus any depreciation deductions you claimed if you rented out the property.
Start with what you paid for the property, including closing costs like title insurance, recording fees, and attorney fees. Then add the cost of any capital improvements — major upgrades that add value or extend the life of the property. New roof, kitchen remodel, addition, new HVAC system, or new windows all count. Repairs and maintenance do not count; only improvements.
If you rented out the property or used part of it as a business, you may have claimed depreciation deductions on your tax returns. Depreciation reduces your basis. Subtract the total depreciation you claimed from your basis. This matters because the IRS will tax you on that depreciation when you sell, even if you did not actually gain it back.
Example: You bought a house for $250,000. You spent $50,000 on a kitchen and bathroom remodel. You claimed $30,000 in depreciation deductions because you rented it out for five years. Your adjusted basis is $250,000 + $50,000 − $30,000 = $270,000.
Calculate your amount realized (what you actually received)
Your amount realized is the sale price minus the costs you paid to sell the property. This is not the same as the price on the contract.
Subtract real estate agent commissions (typically 5% to 6% of the sale price), title company fees, recording fees, transfer taxes, and any other closing costs you paid as the seller. Some states and counties charge transfer taxes; others do not. Your title company or closing attorney will tell you what you owe.
Example: You sold the house for $400,000. The real estate agent took $24,000 (6%). Closing costs were $3,000. Your amount realized is $400,000 − $24,000 − $3,000 = $373,000.
Find your capital gain (amount realized minus adjusted basis)
Subtract your adjusted basis from your amount realized. The result is your capital gain.
Using the examples above: $373,000 (amount realized) − $270,000 (adjusted basis) = $103,000 (capital gain).
If the amount realized is less than your adjusted basis, you have a capital loss instead. You cannot use a capital loss from real estate to offset other income, but you can carry it forward to future years in some cases. Consult a tax professional about losses.
explore the primary residence exclusion if you may have access to
If the property was your primary residence, you may be able to exclude up to $250,000 of your gain from tax ($500,000 if you are married filing jointly). This is one of the largest tax breaks available to homeowners.
To may have access to, you must have owned the home and lived in it as your main home for at least two of the five years before the sale. The two years do not have to be consecutive. If you owned it for 10 years but lived in it for only the last two years, you still may have access to. If you sold it after living there for only one year, you do not.
If you are married filing jointly, both spouses must meet the two-year test. If one spouse does not, you can exclude only $250,000 instead of $500,000.
Using the example above: Your capital gain was $103,000. If this was your primary residence and you meet the two-year test, you exclude the entire $103,000. Your taxable gain is $0, and you owe no federal capital gains tax.
Determine your federal tax rate based on income
If your gain exceeds the primary residence exclusion (or you do not may have access to for it), your federal tax rate depends on your total taxable income for the year, not just the gain itself.
For 2024, the long-term capital gains brackets are:
- 0% rate: Single filers with taxable income up to $47,025; married filing jointly up to $94,050.
- 15% rate: Single filers with taxable income from $47,026 to $518,900; married filing jointly from $94,051 to $583,750.
- 20% rate: Single filers with taxable income over $518,900; married filing jointly over $583,750.
These brackets change each year. The IRS publishes updated brackets in January. Your taxable income includes wages, interest, dividends, and capital gains combined.
Example: You are single with $60,000 in wages and a $103,000 capital gain (after the primary residence exclusion does not explore). Your total taxable income is $163,000. Your capital gain falls in the 15% bracket. You owe 15% × $103,000 = $15,450 in federal capital gains tax.
Account for state and local taxes
Federal tax is only part of the bill. Your state may also tax capital gains on real estate sales.
Nine states have no income tax and therefore no capital gains tax: Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire (though New Hampshire taxes investment income only, not capital gains). If you live in one of these states, you owe no state capital gains tax.
Most other states tax capital gains as ordinary income at your state income tax rate, which ranges from about 1% to 13% depending on the state and your income level. A few states — California, Illinois, and Washington — have separate capital gains taxes on top of income tax.
Look up your state's capital gains tax rate on your state revenue department website. Add that percentage to your federal rate to find your total tax burden. Example: If you owe 15% federal and your state charges 5%, your total rate is 20%.
Frequently Asked Questions
Do I have to pay capital gains tax if I sell my primary home?
Not if your gain is under $250,000 (or $500,000 if married filing jointly) and you lived in the home for at least two of the last five years. Most primary home sales fall under this exclusion. You still have to report the sale on your tax return, but you owe no tax on the excluded amount.
What counts as a capital improvement?
Capital improvements add value to the property or extend its useful life. A new roof, kitchen remodel, deck, HVAC system, or foundation repair all count. Painting, lawn care, and routine maintenance do not. If you are unsure, ask your tax professional or check IRS Publication 523.
What if I inherited the property?
You receive a stepped-up basis equal to the property's fair market value on the date of death, not what the previous owner paid. If you sell it shortly after inheriting it, you owe little or no capital gains tax. This applies only to inherited property, not gifts.
Can I deduct a loss if I sell my home for less than I paid?
No. Capital losses on personal residences cannot be deducted. If you rented out the property or used it as a business, you may be able to deduct the loss, but the rules are complex. Consult a tax professional.
When do I have to report the sale to the IRS?
You report it on Form 8949 and Schedule D when you file your tax return for the year of the sale. Even if you owe no tax because of the primary residence exclusion, you must still file the forms. Your title company or real estate agent will send you a 1099-S if the sale price exceeded a certain threshold.