What Capital Gains Tax Means for a Home or Property Sale
Capital gains tax is a tax on the profit you make when you sell real estate for more than you paid for it. The difference between your sale price and what you originally paid — adjusted for certain costs — is your gain, and the federal government taxes that gain at rates between 0% and 20%, depending on your income level and how long you owned the property.
Most homeowners do not owe this tax because the law lets you exclude up to $250,000 in gains if you are single, or $500,000 if you are married filing jointly, as long as you lived in the home for at least two of the last five years before the sale. Investment properties and rental homes do not get this exclusion, so you will owe tax on the full gain.
State and local taxes add to the federal rate. Some states tax capital gains as ordinary income, some tax them at a lower rate, and a few do not tax them at all. Your total tax bill depends on where you live, how much you earned that year, and whether the property was your primary home.
Key Takeaways
- Capital gains tax applies to the profit on a real estate sale — the sale price minus what you paid, plus deductible costs like improvements.
- Homeowners can exclude up to $250,000 (single) or $500,000 (married) in gains if they lived in the home for at least two of the last five years.
- Investment properties and rentals do not get the exclusion, so you owe tax on the entire gain at rates up to 20% federally, plus state and local taxes.
- How long you owned the property matters: long-term gains (over one year) are taxed at lower rates than short-term gains (one year or less).
- Deductible costs include home improvements, closing costs when you bought, and selling expenses, which reduce the gain you owe tax on.
How Your Holding Period Affects the Tax Rate
The length of time you owned the property divides capital gains into two categories, each taxed differently. Long-term capital gains — from property you owned for more than one year — are taxed at 0%, 15%, or 20%, depending on your total income for the year. Short-term capital gains — from property you owned for one year or less — are taxed as ordinary income, which means the same rates as your salary or wages, ranging from 10% to 37%.
For most people selling a home, the long-term rate applies because few people own a house for less than a year. The 0% rate applies if your income is below $44,625 (single) or $89,250 (married filing jointly) in 2024. The 15% rate applies to income between those thresholds and $492,300 (single) or $553,850 (married). Income above those amounts is taxed at 20%.
These income thresholds change each year. If you are close to a threshold, the timing of your sale can matter — selling in a year when your other income is lower might move you into a lower tax bracket.
What Costs You Can Subtract From Your Gain
Your taxable gain is not the full sale price minus the purchase price. You can reduce the gain by subtracting certain costs. Your cost basis — the starting point for calculating gain — includes the price you paid plus closing costs when you bought, such as title insurance, recording fees, and attorney fees. After you own the property, you can add the cost of improvements that add value or extend the life of the home, such as a new roof, kitchen renovation, or addition.
You cannot deduct routine maintenance like painting, repairs, or lawn care. The difference is that improvements add lasting value, while maintenance keeps the property in its current condition. When you sell, you can also subtract selling costs such as real estate agent commissions, title insurance for the buyer, and attorney fees — typically 5% to 10% of the sale price.
Keep receipts and records for all improvements and closing costs. If you inherited the property, your cost 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 the gain.
The Primary Residence Exclusion and Who Qualifies
If the property was your main home, you may be able to exclude $250,000 (single) or $500,000 (married filing jointly) of your gain from federal tax. To use this exclusion, you must have owned the home for at least two of the five years before the sale, and you must have lived in it as your primary residence for at least two of those five years. The two years do not have to be consecutive, and they do not have to be the two years right before the sale.
You can use this exclusion only once every two years. If you sold another home and used the exclusion within the past two years, you cannot use it again. If you are married, both spouses must meet the ownership and residence test to claim the full $500,000 exclusion; if only one spouse meets the test, the exclusion is $250,000.
If you lived in the home for less than two years because of a job change, health condition, or unforeseen circumstance, you may be able to claim a partial exclusion. The IRS has specific rules about what qualifies, so check the details if your situation is unusual.
Capital Gains Tax on Rental Properties and Investment Real Estate
Rental properties and investment real estate do not get the primary residence exclusion. You owe capital gains tax on the full profit, at the long-term or short-term rate depending on how long you owned it. However, rental properties have a different tax advantage: depreciation.
While you own a rental, you can deduct a portion of the building's cost each year as depreciation, which lowers your taxable income during those years. When you sell, the IRS recaptures that depreciation — it taxes you on the depreciation deductions you took, at a rate of 25%, separate from the capital gains tax on the remaining profit. This means your total tax bill on a rental property sale is often higher than on a primary residence, even though you got a tax break while you owned it.
If you own multiple rental properties or are in a high tax bracket, the depreciation recapture can be substantial. A tax professional can help you understand the full impact before you sell.
State and Local Taxes on Real Estate Sales
Federal capital gains tax is only part of the bill. Most states tax capital gains, though the rate and rules vary widely. Some states, such as California and New York, tax capital gains as ordinary income at rates up to 13% or more. Others, such as Florida, Texas, and Washington, do not tax capital gains at all. A few states, including Colorado and North Carolina, tax capital gains at a lower rate than ordinary income.
Some cities and counties also impose local taxes on real estate sales or capital gains. New York City, for example, has a real estate transfer tax. These local taxes are separate from state and federal taxes and can add 1% to 4% to your total bill depending on where the property is located.
If you are selling property in a state different from where you live, you may owe tax in both states. The state where the property is located generally has the right to tax the gain. You may be able to claim a credit on your home state's return for taxes paid to another state, but the rules are complex and depend on both states' laws.
How to Report Capital Gains on Your Tax Return
When you sell real estate, you report the transaction on Schedule D (Capital Gains and Losses) and Form 8949 (Sales of Capital Assets), which are part of your federal tax return. You will need the sale price, your cost basis, and the date you bought and sold the property. If you used the primary residence exclusion, you report that on Form 8949 as well.
Your real estate agent or closing attorney usually provides a settlement statement that shows the sale price and your net proceeds after costs. This is a starting point, but you need to calculate your actual cost basis by adding up the purchase price, closing costs, and improvements. If you do not have records, the IRS allows you to reconstruct them, but having documentation makes the process simpler and protects you if the IRS questions your return.
If you owe depreciation recapture on a rental property, that is reported separately on Form 4797 (Sales of Business Property). A tax professional can help may support you report everything correctly and take all deductions you are may have access to to.
Frequently Asked Questions
Do I owe capital gains tax if I sell my home at a loss?
No. Capital gains tax only applies to gains — profits. If you sell for less than you paid, you have a loss, and you cannot deduct that loss on your federal tax return. However, you may be able to deduct a loss on investment property or rental real estate under certain circumstances; the rules are different for business property.
What if I inherited a house and then sold it?
You likely owe little or no capital gains tax. When you inherit property, your cost basis is stepped up to the fair market value on the date of the person's death. If you sell shortly after inheriting, your gain is the difference between the sale price and that stepped-up value, which is often small or zero. This is one of the biggest tax advantages of inherited property.
Can I avoid capital gains tax by doing a 1031 exchange?
A 1031 exchange lets you sell one investment property and buy another similar property without owing capital gains tax on the sale, as long as you follow strict rules about timing and property type. You must identify a replacement property within 45 days and close on it within 180 days. This is only for investment or business property, not your primary home. The rules are complex, and mistakes can be costly, so work with a tax professional if you are considering this route.
How do I know if my home improvement counts as a deductible cost?
An improvement adds value or extends the life of the home and can be deducted. Examples include a new roof, kitchen remodel, addition, or new HVAC system. Repairs and maintenance — fixing a leaky faucet, repainting, or patching drywall — do not count. If you are unsure, keep the receipt and ask a tax professional; it is better to have documentation than to guess.
What if I sold the house while I was still paying off the mortgage?
The mortgage balance does not affect your capital gains tax. Your gain is based on the sale price minus your cost basis, not on what you owe the lender. If you sell for $400,000 and still owe $200,000 on the mortgage, your gain is calculated from the $400,000 sale price. The lender is paid from the proceeds at closing, but that does not change your taxable gain.