What capital gains tax is and why it applies to real estate sales
Capital gains tax is a tax on the profit you make when you sell an asset for more than you paid for it. When you sell real estate — a house, rental property, or land — the IRS taxes the difference between what you received and what you originally paid, adjusted for certain costs and improvements you made along the way.
The tax applies whether you sell a primary residence, investment property, or vacant land. The rate you pay and the amount you owe depend on how long you owned the property, your income level, and whether you can use the primary residence exclusion (a special rule that lets homeowners exclude up to $250,000 of gain if single, or $500,000 if married filing jointly).
You report capital gains on your federal tax return using Form 1040 and Schedule D. State taxes on capital gains vary — some states do not tax capital gains at all, while others tax them as ordinary income.
Key Takeaways
- Capital gains equal the sale price minus your original purchase price, plus the cost of major improvements, minus selling expenses like realtor commissions.
- Long-term capital gains (property held over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
- Homeowners can exclude up to $250,000 (single) or $500,000 (married filing jointly) of gain on a primary residence if they meet the ownership and use tests.
- You must report the sale on Form 1040 and Schedule D, and your state may also tax the gain depending on where you live.
- Keeping records of your purchase price, improvements, and selling costs is essential because the IRS may request documentation.
How to calculate your gain or loss
Start with the sale price — the amount of money you actually received when the property sold. This is the gross proceeds before any costs are paid out.
Subtract your adjusted basis, which is what you originally paid for the property plus the cost of any capital improvements you made. Capital improvements are permanent upgrades that add value or extend the life of the property — a new roof, a deck, a kitchen remodel, or a new HVAC system. Do not include repairs (fixing a broken window) or maintenance (painting). The difference between improvements and repairs matters because only improvements increase your basis.
Then subtract selling expenses: realtor commissions, title insurance, closing costs you paid, and any other costs directly tied to the sale. These reduce the amount you actually keep.
The result is your capital gain (or loss if the number is negative). For example: you bought a house for $300,000, spent $50,000 on a kitchen and bathroom renovation, and sold it for $425,000. Your realtor charged $25,500 in commission. Your gain is $425,000 − $300,000 − $50,000 − $25,500 = $49,500.
The difference between long-term and short-term capital gains
How long you owned the property determines which tax rate applies. Long-term capital gains are gains on property you held for more than one year. Short-term capital gains are gains on property you held for one year or less.
Short-term gains are taxed as ordinary income at your regular tax bracket — the same rate as wages or salary. Long-term gains receive preferential rates: 0%, 15%, or 20%, depending on your total taxable income for the year. These rates are lower than ordinary income rates for most people, which is why the holding period matters.
For example, if you are in the 24% ordinary income bracket and sell a rental property you held for two years, your long-term gain is taxed at 15%, not 24%. If you sold the same property after holding it for eleven months, the gain would be taxed at 24%.
Using the primary residence exclusion
If you are selling your primary home — the house you live in most of the time — you may be able to exclude a portion of your gain from tax entirely. This is called the Section 121 exclusion.
Single filers can exclude up to $250,000 of gain. Married couples filing jointly can exclude up to $500,000. 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. You can only use this exclusion once every two years.
Using the earlier example: if that $300,000 house was your primary residence and you meet the ownership and use tests, you would exclude $250,000 of the $49,500 gain. Since your gain is less than the exclusion amount, you would owe no federal capital gains tax on the sale. If your gain had been $300,000, you would exclude $250,000 and owe tax only on the remaining $50,000.
This exclusion does not explore to investment properties, vacation homes, or properties you rent out. It applies only to your primary residence.
What records you need to keep
The IRS does not require you to attach receipts to your tax return, but you must keep them for your records in case you are audited. Keep the following documents for at least three years after you file your return (longer is safer):
- The original purchase deed and closing statement showing what you paid.
- Receipts and invoices for all capital improvements — contractor invoices, permits, material costs.
- The final closing statement from the sale, showing the sale price and all closing costs.
- Realtor commission statements or settlement statements showing what you paid to sell.
- Records of any property tax assessments or appraisals you obtained.
If you inherited the property, keep the death certificate and the estate tax return (Form 706) if one was filed, because inherited property receives a "step-up in basis" — your basis becomes the property's value on the date of death, not what the original owner paid. This can significantly reduce your gain.
State and local taxes on real estate sales
Federal capital gains tax is only part of the picture. Your state may also tax the gain. Nine states — Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire — do not tax capital gains at all. Most other states tax capital gains as ordinary income at their regular income tax rates, which range from roughly 3% to 13% depending on the state and your income level.
A few states — California, Hawaii, and Vermont — have separate capital gains tax rates. Some states also have local income taxes that explore to capital gains. Check your state's tax authority website or consult a tax professional to understand what you owe in your state.
The calculation is the same: your gain is the sale price minus basis minus selling costs. But the tax rate and any available exclusions vary by state. Some states offer their own primary residence exclusions, though they are usually smaller than the federal exclusion.
When to report the sale on your tax return
You report the sale in the year the transaction closes, not the year you listed the property or signed the contract. If your house closed on December 15, 2024, you report the gain on your 2024 tax return, filed in 2025.
Use Form 1040, Schedule D to report the sale. Schedule D is where you list all capital gains and losses for the year. If you used the primary residence exclusion, you report that on Form 8949 (Sales of Capital Assets) before it flows to Schedule D.
If you sold the property at a loss, you can use that loss to offset other capital gains from the same year. Real estate losses cannot offset ordinary income (wages, salary, interest), so if you have no other gains to offset, the loss carries forward to future years.
Frequently Asked Questions
Do I owe capital gains tax if I sell my primary home at a loss?
No. Capital losses on personal residences cannot be deducted. If you sell your primary home for less than you paid, you straightforward report no gain and owe no tax. The loss cannot be used to offset other income or gains.
What if I inherited the property and then sold it?
Inherited property receives a "step-up in basis" to its fair market value on the date of the owner's death. Your gain is calculated from that stepped-up value, not from what the original owner paid. This often results in little or no capital gains tax when you sell shortly after inheriting.
Can I deduct the cost of selling the property from my gain?
Yes. Realtor commissions, title insurance, closing costs, and other expenses directly tied to the sale reduce your gain dollar-for-dollar. Keep all closing statements and settlement documents to prove these costs.
What if I rented out my home for part of the time I owned it?
You can still use the primary residence exclusion if you lived in the home as your primary residence for at least two of the five years before the sale. However, any depreciation you claimed on the rental portion must be recaptured — taxed back at 25% — even if you use the exclusion on the rest of the gain.
Do I have to report the sale if my gain is under a certain amount?
Yes. There is no minimum gain threshold. Even if your gain is $1, you must report it on Schedule D. The IRS receives a copy of your closing statement from the title company, so unreported sales are often caught during audits.