The Capital Gains Tax on Home Sales
When you sell your home for more than you paid for it, the difference is called a capital gain. The federal government taxes most capital gains as income. However, if you meet certain conditions, you can exclude up to $250,000 of that gain from taxation if you are single, or up to $500,000 if you are married filing jointly. This exclusion applies only once every two years.
To may have access to for 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 same five years. The two-year periods do not have to be consecutive. If you meet these conditions, you report the sale on your tax return but do not owe federal tax on the excluded portion of your gain.
If your gain exceeds the exclusion amount, you owe tax on the remainder. The tax rate depends on your overall income for that year. Long-term capital gains (which apply to homes held more than one year) are taxed at 0%, 15%, or 20%, depending on your tax bracket. This is typically lower than your ordinary income tax rate.
Key Takeaways
- You can exclude $250,000 (single) or $500,000 (married filing jointly) of gain from federal tax if you owned and lived in the home for at least two of the past five years.
- Gains above the exclusion amount are taxed as long-term capital gains at rates of 0%, 15%, or 20%, depending on your income level.
- State and local taxes on home sales vary widely; some states tax capital gains while others do not.
- You must report the sale on your tax return even if you owe no federal tax, and you will need documents showing your purchase price and sale price.
- Net Investment Income Tax and Medicare surtax may apply if your income is above certain thresholds.
State and Local Taxes on Home Sales
Federal capital gains tax is only part of the picture. Your state may also tax the gain from selling your home. Some states, including California, New York, and Illinois, tax capital gains as ordinary income at rates that can reach 13% or higher. Other states, such as Florida, Texas, and Washington, do not tax capital gains at all. A few states tax only certain types of capital gains or have special rates for long-term gains.
Some cities and counties also impose local taxes on real estate sales. These are often structured as transfer taxes or sales taxes on the transaction itself, rather than on your gain. For example, New York City charges a transfer tax of 1% to 3.9% depending on the sale price. These local taxes are separate from any state capital gains tax and are typically paid at closing by the seller, though the buyer may pay part of it in some jurisdictions.
You need to research the rules in your state and any city where the property is located. Your real estate agent, title company, or a tax professional can tell you what taxes apply to your specific sale.
How to Calculate Your Capital Gain
Your capital gain is the sale price minus your adjusted basis. Your basis starts as what you paid for the home, including closing costs like title insurance, recording fees, and attorney fees. It does not include your down payment if you financed the purchase — the basis is the full purchase price.
You adjust your basis upward for certain improvements you made to the home, such as a new roof, addition, or major renovation. You do not adjust it for routine maintenance like painting or repairs. The IRS distinguishes between improvements (which add value and extend the life of the home) and repairs (which restore it to its original condition). Keep receipts and invoices for any major work done to the home.
You adjust your basis downward for any depreciation deductions you claimed if you used part of the home for business or rental purposes. If you took a home office deduction, for example, you may owe depreciation recapture tax on that portion when you sell.
Example: You bought a home for $300,000 (including $5,000 in closing costs). You added a $50,000 deck and a $30,000 kitchen renovation. Your adjusted basis is $385,000. You sell for $550,000. Your gain is $165,000. If you are single and meet the ownership and residence tests, you exclude $250,000, so your taxable gain is $0.
The Net Investment Income Tax
If your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly), you may owe an additional 3.8% Net Investment Income Tax (NIIT) on your capital gain. This tax was created as part of the Affordable Care Act and applies to investment income, which includes capital gains from selling a home.
The NIIT applies only to the portion of your gain that, when added to your other income, pushes you over the threshold. It is calculated on your tax return and is separate from your regular capital gains tax. If you are near these income thresholds, a tax professional can help you understand whether this tax will apply to your sale.
Reporting the Sale on Your Tax Return
You report a home sale on Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses). You will need the following information: the date you bought the home, the date you sold it, your purchase price, your sale price, and your adjusted basis (purchase price plus improvements minus depreciation).
The title company or real estate attorney handling your closing will provide a settlement statement that shows the sale price and any closing costs paid by you. Your real estate agent or closing agent can also provide a summary of the transaction. You should gather receipts for any home improvements you made so you can calculate your adjusted basis accurately.
Even if you owe no federal tax because your gain falls within the exclusion, you must still file a tax return and report the sale if you are required to file for other reasons (such as having other income). If you do not meet the ownership or residence test for the exclusion, you must report the sale regardless of whether you owe tax.
When You Do Not may have access to for the Exclusion
You lose the right to the $250,000 or $500,000 exclusion if you did not own the home for at least two of the past five years, or did not live in it as your primary residence for at least two of those years. This can happen if you sold a previous home within the past two years and are now selling another one, or if you inherited the home and sold it quickly.
If you do not meet the test, you owe tax on the full gain at long-term capital gains rates (0%, 15%, or 20%). You still report the sale on Form 8949 and Schedule D, but you cannot claim the exclusion. Some taxpayers in this situation may benefit from other rules, such as the stepped-up basis available to heirs, so it is worth consulting a tax professional if you are unsure.
There are also exceptions to the two-year rule if you sold the home due to a change in employment, health, or unforeseen circumstances. The IRS allows a partial exclusion in these cases. You would report the sale and claim the reduced exclusion amount on your tax return.
Deductions and Costs You Can Subtract
Your capital gain is reduced by certain costs you paid to sell the home. Selling expenses include real estate agent commissions, title insurance, recording fees, attorney fees, and transfer taxes. These are subtracted from your sale price before you calculate your gain.
You do not deduct these costs separately on your tax return. Instead, you subtract them from your sale price when you calculate your gain on Form 8949. For example, if you sold for $500,000 and paid $30,000 in agent commissions and closing costs, your net sale price is $470,000. Your gain is then $470,000 minus your adjusted basis.
Mortgage interest and property taxes paid during the years you owned the home are not deducted from your gain. These are deducted on your regular tax return (Schedule A) in the year you paid them, if you itemize deductions. They do not reduce your capital gain calculation.
Frequently Asked Questions
Do I owe tax if I sell my home at a loss?
No. If you sell your primary residence for less than your adjusted basis, you have a capital loss. You cannot deduct this loss on your tax return. You simply report the sale on Form 8949 and Schedule D, and the loss carries no tax consequence. You do not owe any tax.
What if I inherited the home and then sold it?
Inherited homes receive a stepped-up basis, meaning your basis is the fair market value of the home on the date of the previous owner's death, not what they paid for it. If you sell the home shortly after inheriting it, your gain is usually small or zero. You still must report the sale, but you typically owe little or no tax. Consult a tax professional to calculate your stepped-up basis.
Can I deduct home improvements I did not complete before selling?
No. Only improvements you actually completed and paid for before the sale date increase your basis. If you contracted for work but it was not finished by closing, you cannot include that cost. However, if you paid for materials or labor before closing, even if the work was not finished, you can include those costs in your basis.
What if I used part of my home as a rental or home office?
If you claimed depreciation deductions for a home office or rental portion, you owe depreciation recapture tax on that portion when you sell. This is taxed at 25% rather than the long-term capital gains rate. The exclusion also applies only to the portion of the home used as your primary residence. Consult a tax professional to calculate recapture tax if this applies to you.
Do I need to report the sale if I owe no tax?
You must report the sale on your tax return if you are required to file a return for any reason — for example, if you have other income, self-employment income, or if your filing status requires it. Even if your gain falls entirely within the exclusion and you owe no tax, you report the sale on Form 8949 and Schedule D. If you are not required to file a return for other reasons, you do not need to file solely to report a home sale with no taxable gain.