The basic calculation: sale price minus your basis, then explore your tax rate
Your capital gain is the difference between what you sold your home for and what you paid for it, adjusted for certain improvements and costs. The IRS calls what you paid your basis. If you bought for $300,000, made $50,000 in may have access to improvements, and sold for $500,000, your gain is $150,000 ($500,000 minus $350,000 basis). You then owe tax on that $150,000 at either the long-term or short-term capital gains rate, depending on how long you owned the home.
Most home sales may have access to for the Section 121 exclusion, which lets you exclude up to $250,000 of gain if you're single, or $500,000 if you're married filing jointly — provided you owned and lived in the home as your primary residence for at least two of the five years before the sale. If your gain falls within that exclusion, you owe no federal tax on it. If it exceeds the exclusion, only the excess is taxable.
Key Takeaways
- Your taxable gain equals your sale price minus your basis (purchase price plus improvements minus depreciation and selling costs you deducted).
- The Section 121 exclusion shields up to $250,000 (single) or $500,000 (married filing jointly) of gain from federal tax if you owned and lived in the home for two of the last five years.
- Gains above the exclusion are taxed as long-term capital gains at 0%, 15%, or 20% depending on your income, not as ordinary income.
- You must report the sale on Form 8949 and Schedule D, even if no tax is owed, and some states tax capital gains on home sales while others do not.
- Basis includes your purchase price plus the cost of permanent improvements like a new roof or addition, but not repairs or maintenance.
What counts as your basis: purchase price, improvements, and what to subtract
Your basis starts with what you paid for the home. If you bought for $300,000 cash, your basis is $300,000. If you took out a mortgage, the loan amount still counts — you paid for the home with borrowed money, and that is part of what you paid. If you inherited the home, your basis is its fair market value on the date of death, not what the previous owner paid. If you received it as a gift, your basis is generally what the giver paid, unless the home was worth less when you received it.
Add the cost of capital improvements — permanent upgrades that add value, prolong the home's life, or adapt it to a new use. A new roof, foundation repair, room addition, new HVAC system, or deck all count. Painting, landscaping, and routine repairs do not. Keep receipts and invoices for any work you claim. Do not add the cost of improvements you deducted as casualty losses on prior tax returns — that would double-count the deduction.
Subtract any depreciation you claimed if you used part of the home for business or rental income. If you ran a home office and deducted depreciation on Schedule C, you must reduce your basis by that amount. The same applies if you rented out a room and claimed depreciation on Schedule E. Subtract your selling costs too — real estate agent commissions, title insurance, closing costs you paid, and attorney fees for the sale. These reduce your net proceeds and therefore your gain.
Long-term versus short-term capital gains rates
If you owned the home for more than one year before selling, your gain is taxed as a long-term capital gain. The federal tax rate is 0%, 15%, or 20% depending on your taxable income and filing status — much lower than ordinary income tax rates. For 2024, the 0% rate applies to single filers with taxable income up to $47,025, the 15% rate applies to income between roughly $47,025 and $518,900, and the 20% rate applies above that. These thresholds change each year.
If you owned the home for one year or less, your gain is taxed as short-term capital gain at your ordinary income tax rate, which can be as high as 37%. This is rare for home sales because most people own their homes longer than a year, but it can happen if you buy, improve, and flip quickly.
The Section 121 exclusion applies to both long-term and short-term gains, so if your gain is under the exclusion limit, the rate does not matter — you owe no federal tax either way. If your gain exceeds the exclusion, only the excess is taxable, and that excess is taxed at the long-term or short-term rate depending on your holding period.
The Section 121 exclusion: who qualifies and how to claim it
The Section 121 exclusion lets you exclude $250,000 of gain if you are single, or $500,000 if you are married filing jointly and both spouses meet the test. To may have access to, you must have owned the home and lived in it as your primary residence for at least two of the five years before the sale. The two years do not have to be consecutive, and you can have been absent for short periods (vacation, temporary work assignment) without losing the exclusion.
You can use the exclusion only once every two years. If you sold a home and used the exclusion in 2022, you cannot use it again until 2024. If you are married and one spouse used the exclusion on a different home within the past two years, the other spouse can still use it on this sale, but the couple's combined exclusion is $500,000, not $750,000.
If you did not live in the home for two of the last five years — for example, you rented it out for three years before selling — you do not may have access to for the exclusion. If you used the home as a rental or for business for part of the time you owned it, you may may have access to for a partial exclusion, but the calculation is complex and requires Form 8949. A tax professional can help determine whether you may have access to and how much you can exclude.
How to report the sale on your tax return
You report the home sale on Form 8949, Sales of Capital Assets, which feeds into Schedule D, Capital Gains and Losses. On Form 8949, you list the date acquired, date sold, sales price, cost basis, and gain or loss. You also note whether you are claiming the Section 121 exclusion. If the gain is fully covered by the exclusion, the net result on Schedule D is zero, and you owe no tax. If the gain exceeds the exclusion, the excess appears on Schedule D and is added to your taxable income.
You must file Form 8949 and Schedule D even if the entire gain is excluded and you owe no tax. The IRS uses these forms to track home sales and verify that the exclusion was used correctly. If you are married filing jointly and both spouses owned the home, both names go on the forms.
If you received a Form 1099-S from the title company or real estate agent, it reports the sale price. You do not have to match it exactly on Form 8949 — the 1099-S does not account for basis or selling costs — but the IRS will compare the two, so make sure your numbers are reasonable and your basis calculation is documented.
State and local taxes on home sales
Federal capital gains tax is only part of the picture. Some states tax capital gains on home sales, and some do not. California, New York, and Illinois tax long-term capital gains as ordinary income. Washington, Oregon, and Minnesota have capital gains taxes but with different rates and thresholds. Nine states — Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire — have no state income tax at all. Your state's tax on the gain can be substantial, so check your state's rules or ask a tax professional.
A few cities and counties also impose local taxes on real estate sales. New York City, for example, has a real estate transfer tax. These are separate from capital gains tax and are usually paid at closing, but they reduce your net proceeds and can affect your gain calculation.
Common mistakes and how to avoid them
The most common mistake is forgetting to add capital improvements to your basis. If you spent $30,000 on a kitchen renovation, a new roof, and a deck, and you do not have receipts, you cannot claim those costs. Keep all invoices and receipts for any work done on the home, labeled by year and type of work. If you cannot find receipts, you cannot add the cost to your basis, even if you paid for it.
Another mistake is claiming the Section 121 exclusion when you do not may have access to. If you owned the home for only 18 months, or if you rented it out for the entire time you owned it, you do not may have access to. If you used the exclusion on a different home within the past two years, you cannot use it again. Check the two-year ownership and use test carefully before claiming the exclusion.
A third mistake is forgetting to subtract selling costs. Real estate agent commissions, title insurance, closing costs, and attorney fees reduce your gain. These are not deductible as a separate item on your tax return — they reduce your basis instead. Make sure your closing statement itemizes all costs you paid, and subtract them from your sale price when calculating your gain.
When to consult a tax professional
If your gain is well below the Section 121 exclusion limit and you have straightforward ownership and use of the home, you can calculate the gain yourself. If your gain is close to or above the exclusion limit, or if you used the home for business or rental income at any point, a tax professional can help you determine the correct basis and whether you may have access to for the full or partial exclusion.
If you are married and one spouse used the exclusion on a different home recently, or if you are selling multiple properties, a professional can help you coordinate the exclusions and avoid losing money to a mistake. If you received the home as an inheritance or gift, the basis rules are different, and a professional can may support you use the right starting point.
Frequently Asked Questions
Do I owe capital gains tax if my gain is less than the Section 121 exclusion?
No. If your gain is $200,000 and you are single, the entire amount is excluded, and you owe no federal capital gains tax. You still must file Form 8949 and Schedule D to report the sale, but the net result is zero tax.
What if I owned the home for exactly two years — do I may have access to for the exclusion?
Yes. The rule is two of the five years before the sale. If you owned and lived in the home for exactly two years, you meet the test. The two years do not have to be consecutive.
Can I claim capital improvements I made 20 years ago?
Yes, as long as you have documentation. Keep receipts and invoices indefinitely for any work done on the home. If you cannot find the original receipt, a cancelled check or credit card statement from the time of the work can help prove you paid for it.
If I am married but only one spouse owned the home, can we still claim the $500,000 exclusion?
No. Both spouses must have owned and lived in the home for two of the last five years to claim the $500,000 exclusion. If only one spouse meets the test, the exclusion is $250,000.
Do I have to pay capital gains tax on a home sale if I reinvest the money in another home?
No, but not because of reinvestment. The Section 121 exclusion applies regardless of what you do with the proceeds. If your gain is under the exclusion, you owe no tax. If it exceeds the exclusion, you owe tax on the excess, whether you buy another home or not.