Skip to main content

HomeAll guides

What Taxes You'll Pay When You Sell Your Home

The basics of capital gains tax on home sales

When you sell your home for more than you paid for it, the profit is called a capital gain, and it may be subject to federal income tax. However, the IRS lets most homeowners exclude a significant portion of that gain from taxation. If you're single, you can exclude up to $250,000 of gain. If you're married filing jointly, you can exclude up to $500,000. That means many people owe no federal tax on a home sale at all.

To use this exclusion, 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 exclusion applies once every two years, so if you sold a home recently and used the exclusion, you cannot use it again until two years have passed.

The gain itself is calculated by subtracting your basis (what you paid for the home, plus certain improvements) from the sale price. If your gain is below the exclusion limit for your filing status, you owe no federal capital gains tax. If it exceeds the limit, you pay tax only on the amount above the exclusion.

Key Takeaways

  • Single filers can exclude up to $250,000 of home sale gain from federal tax; married filers can exclude up to $500,000, provided they owned and lived in the home for two of the last five years.
  • Your basis includes the purchase price plus the cost of major improvements like a new roof or addition, but not routine maintenance or repairs.
  • State and local taxes on home sales vary widely — some states have no capital gains tax, while others tax the full gain or charge a transfer tax at closing.
  • You must report the sale on your tax return even if you owe no tax, and you'll need records of your purchase price and any improvements you made.
  • If you're married but filing separately, or if you've used the exclusion within the past two years, your exclusion amount may be reduced or unavailable.

How to calculate your basis and gain

Your basis starts with the price you paid for the home. If you inherited the home, your basis is typically its fair market value on the date of the previous owner's death, not what they paid for it. If you received the home as a gift, your basis is generally what the giver paid for it.

After you establish your starting basis, you add the cost of capital improvements — permanent upgrades that add value or extend the life of the home. A new roof, a deck, a finished basement, new plumbing, or a kitchen remodel all count. You do not add the cost of repairs or maintenance, such as repainting, fixing a leak, or replacing a broken window. The IRS distinguishes between improvements (which raise basis) and repairs (which do not).

Once you know your basis, subtract it from the sale price to find your gain. The sale price includes the cash you receive plus any debt the buyer assumes. If you sold for $450,000 and your basis was $300,000, your gain is $150,000. If that gain is below your exclusion limit, you owe no federal capital gains tax on it.

State and local taxes on home sales

Federal capital gains tax is only part of the picture. Your state and local government may also tax the sale. The rules vary dramatically by location, and some states have no capital gains tax at all.

Several states — including Florida, Texas, Washington, and Wyoming — do not tax capital gains. Other states tax capital gains as ordinary income at rates that can reach 13% or higher. A few states, including California, impose an additional tax on high-income earners' capital gains. You need to know the rules in the state where the home is located, not necessarily where you live now.

In addition to capital gains tax, many states and cities charge a transfer tax or sales tax on the sale itself. This is a one-time fee paid at closing, usually by the seller, and it's calculated as a percentage of the sale price. Some areas charge 1% to 2% of the sale price; others charge much less or nothing. Your real estate agent or closing attorney can tell you what applies in your area.

Deductions and expenses you can subtract from your gain

You can reduce your gain by subtracting certain costs associated with the sale. Selling expenses — such as real estate agent commissions, title insurance, attorney fees, and inspection costs — lower your net proceeds and therefore lower your taxable gain. These are not deductions on your tax return; they reduce the sale price itself for the purpose of calculating gain.

If you made improvements to the home, keep records of what you spent. Receipts, invoices, and contractor statements all help prove your basis. If you cannot document an improvement, the IRS may not allow it, so the more records you have, the better.

You cannot deduct the cost of a home office, even if you used part of your home for business. That creates a different tax situation (depreciation recapture) that can actually increase your tax liability. If you used your home for business, consult a tax professional before selling.

When you don't may have access to for the full exclusion

The $250,000 or $500,000 exclusion is not available to everyone. If you used the exclusion on another home sale within the past two years, you cannot use it again until two years have passed from that earlier sale. You can use a partial exclusion if you sold a previous home between one and two years ago, but the amount is reduced.

If you're married but file separate tax returns, each spouse can exclude only $125,000, not $250,000 each. If you inherited the home or received it as a gift, you may still may have access to for the exclusion, but you must meet the ownership and use tests based on your time in the home, not the previous owner's.

If you lived in the home for less than two of the five years before the sale — perhaps because you were transferred for work or had a change in circumstances — you may not may have access to for the exclusion at all. In some cases, the IRS allows a reduced exclusion if you sold due to a job change, health issue, or unforeseen circumstance, but you must meet specific criteria.

Reporting the sale on your tax return

You must report the home sale on your federal tax return even if you owe no tax. You'll use Form 8949 (Sales of Capital Assets) and Schedule D (Capital Gains and Losses) to report the transaction. The title company or your real estate agent will send you a Form 1099-S if the sale price met certain thresholds, though not all sales generate this form.

On the form, you report the sale price, your basis, your gain, and the exclusion you're claiming. If you have no gain after the exclusion, your taxable gain is zero. If you have a loss (you sold for less than your basis), you generally cannot deduct that loss, but you still report it on your return.

Keep all documentation — the purchase deed, closing statement, receipts for improvements, and the sale closing statement — for at least three years after you file your return. The IRS can audit returns for up to three years, and having records makes the process straightforward.

Special situations: investment property and second homes

The $250,000 or $500,000 exclusion applies only to your primary residence. If you sell a vacation home, rental property, or investment property, you do not may have access to for the exclusion. You must pay tax on the full gain (minus selling expenses) at capital gains rates.

If you converted a rental property to your primary residence, or vice versa, the rules become more complex. You may may have access to for a partial exclusion based on the time you lived there as your primary home, but you'll owe tax on the portion of the gain that accrued while it was a rental. Depreciation you claimed on a rental property also creates a tax called depreciation recapture, which is taxed at a higher rate.

If you own a home jointly with someone who is not your spouse, each owner's exclusion is $250,000, not $500,000. The ownership and use tests explore to each owner individually.

Frequently Asked Questions

Do I have to pay capital gains tax if I sell my home for a loss?

No. If you sell your primary residence for less than your basis, you have no taxable gain and owe no capital gains tax. You also cannot deduct the loss on your tax return. You still must report the sale on Form 8949 and Schedule D, showing a loss of zero taxable gain.

What if I lived in the home for only one year before selling?

You do not meet the two-year ownership and use test, so you cannot use the standard $250,000 or $500,000 exclusion. However, if you sold due to a job change, health issue, or other unforeseen circumstance, you may may have access to for a reduced exclusion. You'll need to file Form 8801 and meet IRS criteria for the exception.

Do I owe capital gains tax if my state has no capital gains tax?

You still owe federal capital gains tax if your gain exceeds the exclusion limit. State capital gains tax is separate. If your state has no capital gains tax, you owe nothing to the state, but you still file the federal return and pay federal tax if required. Check your state's tax authority website to confirm your state's rules.

Can I use the exclusion if I'm selling my parents' home after they pass away?

If you inherited the home, your basis is stepped up to its fair market value on the date of death, which usually means you have little or no gain. You can use the exclusion if you lived in the home as your primary residence for two of the five years before the sale, but most inherited homes have no taxable gain because of the step-up in basis.

What records do I need to keep to prove my improvements?

Keep receipts, invoices, and contracts from contractors or suppliers. Photos before and after the work can help. For major projects, keep the permit and inspection records. If you paid cash, a cancelled check or bank statement showing the withdrawal helps prove the expense. The more documentation you have, the easier it is to defend your basis if the IRS questions it.

This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.