Capital gains tax is the federal tax you owe on the profit when you sell property for more than you paid for it
When you sell a house, rental property, or land, the IRS taxes the difference between what you paid (your basis) and what you sold it for (your sale price). That difference is your capital gain. The tax rate depends on how long you owned the property and your total income that year. You do not owe capital gains tax on the full sale price — only on the profit.
Real estate capital gains are taxed differently than regular income. If you owned the property for more than one year before selling, you pay long-term capital gains rates, which are lower than ordinary income tax rates. If you owned it for one year or less, you pay short-term capital gains rates, which are the same as your regular income tax bracket.
There is one major exception: if the property was your primary residence, you may not owe any capital gains tax at all. The IRS lets you exclude up to $250,000 of gain if you are single, or $500,000 if you are married filing jointly, as long as you meet the ownership and use tests.
Key Takeaways
- Capital gains tax applies only to your profit (sale price minus what you paid), not to the entire sale price.
- Long-term capital gains (property owned over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
- If you sold your primary residence and meet IRS tests, you can exclude $250,000 (single) or $500,000 (married) of gain from taxation.
- Your basis includes the purchase price plus certain improvements, but not routine maintenance or repairs.
- State and local taxes may also apply to capital gains on real estate sales in your state.
How your basis is calculated
Your basis is the starting point for calculating gain. It is usually the price you paid for the property, plus closing costs like title insurance, recording fees, and attorney fees. If you inherited the property, your basis is typically the fair market value on the date of death, not what the previous owner paid.
You can add to your basis by making capital improvements — permanent upgrades that add value or extend the property's life. A new roof, foundation repair, or addition counts. Routine maintenance like painting, repairs, or lawn care does not. Keep receipts and invoices for any work you claim as an improvement, because the IRS may ask for proof.
If you rented out the property and claimed depreciation deductions on your tax returns, you must subtract that depreciation from your basis. This is called depreciation recapture, and it can increase your taxable gain even if the property did not appreciate much in value.
Long-term versus short-term capital gains rates
The holding period matters. If you owned the property for more than one year before selling, your gain is taxed at long-term rates. The 2024 long-term capital gains rates are 0%, 15%, or 20%, depending on your total taxable income for the year. These rates are much lower than ordinary income tax brackets, which go up to 37%.
If you owned the property for one year or less, your gain is taxed as short-term capital gain at your ordinary income tax rate. This applies even if you held it for 11 months. The holding period is measured from the date you acquired the property to the date you sold it.
The long-term rate you pay depends on your filing status and total income that year, not just the real estate sale. If you are single and your taxable income is under $47,025 in 2024, you may pay 0% on long-term gains. Between $47,025 and $518,900, you pay 15%. Above that, you pay 20%. These income thresholds change each year.
The primary residence exclusion
If you sold your main home, you may not owe any capital gains tax on part or all of your profit. The IRS lets you exclude $250,000 of gain if you are single, or $500,000 if you are married filing jointly. To may have access to, you must have owned the home for at least two of the five years before the sale, and lived in it as your primary residence for at least two of those five years.
The two-year periods do not have to be consecutive. If you owned the house for three years, moved out, and sold it two years later, you still may have access to because you met the two-year ownership and use tests within the five-year window. However, if you sold another home and used the exclusion within the past two years, you cannot use it again.
This exclusion applies only to your primary residence, not to rental properties, vacation homes, or investment real estate. If you converted a rental property to your primary residence, the exclusion applies only to the gain that accrued after the conversion, not to the gain while you rented it out.
Capital gains tax on rental and investment properties
Rental properties and investment real estate do not may have access to for the primary residence exclusion. You owe capital gains tax on the entire profit, minus any depreciation recapture. If you owned the property for more than one year, you pay long-term capital gains rates. If you owned it for one year or less, you pay short-term rates.
Depreciation recapture is taxed at 25%, not at your long-term capital gains rate. If you claimed $50,000 in depreciation deductions while renting out the property, you owe 25% tax on that $50,000 ($12,500), even if your long-term capital gains rate is only 15%. The remaining gain is taxed at your long-term rate.
If you sold a rental property at a loss, you cannot deduct the loss on your personal tax return. Real estate losses are treated differently than stock losses. You can carry the loss forward to offset future gains, but the rules are complex and depend on your income level and whether you are a real estate professional.
State and local taxes on real estate sales
Federal capital gains tax is only part of the picture. Most states also tax capital gains on real estate. Some states tax capital gains at the same rate as ordinary income, while others have separate capital gains tax rates. A few states do not tax capital gains at all.
California, for example, taxes capital gains as ordinary income at rates up to 13.3%. New York taxes long-term capital gains at rates up to 10.9%. Washington has a capital gains tax of 7% on long-term gains over $250,000. Check your state's tax rules before you sell, because state tax can add significantly to your bill.
Some cities and counties also impose local transfer taxes or sales taxes on real estate transactions. These are separate from capital gains tax and apply to the sale price, not the gain. Your real estate agent or closing attorney can tell you what local taxes apply in your area.
How to report capital gains on your tax return
When you sell real estate, you report the transaction on Form 8949 (Sales of Capital Assets) and then transfer the totals to Schedule D (Capital Gains and Losses). If you sold your primary residence and are claiming the exclusion, you also file Form 4797 (Sales of Business Property) if the property had any business use, or you report it directly on Schedule D if it was purely residential.
Your real estate agent or closing attorney will provide a Form 1099-S (Proceeds from Broker and Barter Exchange Transactions) if the sale price exceeded $600 in most states (the threshold varies). The IRS receives a copy of this form, so your tax return must match it. If you do not receive a 1099-S, you still must report the sale.
Keep all closing documents, including the settlement statement, deed, and proof of improvements. The IRS can audit a real estate sale for up to three years after you file, or longer if they suspect underreporting. Having documentation of your basis and any capital improvements will protect you if questions arise.
Frequently Asked Questions
Do I owe capital gains tax if I sell my home at a loss?
No. If you sell your primary residence for less than you paid, you do not owe capital gains tax and you cannot deduct the loss. For rental or investment properties, losses cannot be deducted against capital gains on your personal return, though they may offset other income under certain conditions.
What if I inherited real estate and then sold it?
Your basis is the fair market value of the property on the date the previous owner died, not what they paid for it. If the property appreciated after that date and you sold it, you owe capital gains tax only on the appreciation after the inheritance, not on the gain that occurred before. This is called a stepped-up basis.
Can I avoid capital gains tax by doing a 1031 exchange?
A 1031 exchange lets you defer capital gains tax by selling one investment property and buying another similar property within strict timelines. You do not avoid the tax — you postpone it until you eventually sell without doing another exchange. The rules are complex and require a may have access to intermediary, so consult a tax professional before attempting one.
How do I know what my original purchase price was if I bought the house decades ago?
Check your closing documents, mortgage papers, or old tax returns. If you cannot find the original purchase price, the IRS allows you to use tax assessor records, county deed records, or a professional appraisal from around the time of purchase. Document whatever source you use, because the IRS may ask how you determined your basis.
Do I have to pay capital gains tax in the year I sell, or can I defer it?
You report the sale and owe the tax in the year you sell, unless you use a 1031 exchange to defer it. You cannot simply delay reporting it to a future year. If you need to pay the tax in installments, you can request a payment plan from the IRS, but interest and penalties will apply.