How it works
Cash from the sale = sale price − selling costs − mortgage payoff
Gain = sale price − selling costs − (what you paid + improvements)
If you owned the home and lived in it for at least two of the five years before the sale, up to $250,000 of gain is tax-free, or $500,000 for a married couple filing jointly. Any gain above that is taxed as a long-term capital gain, at 0%, 15% or 20% depending on your income, plus the 3.8% net investment income tax at higher incomes.
Worked example
You sell for $500,000. Selling costs of 6% take $30,000 and paying off the mortgage takes $220,000, leaving $250,000.
You bought for $300,000 and spent $20,000 on improvements, so your gain is $150,000, well inside the $500,000 a married couple can exclude. No federal tax is due.
Things to know
- Keep improvement receipts. Additions and upgrades raise your basis and lower your taxable gain; ordinary repairs don't.
- Commissions are negotiable. Selling costs vary with your agent agreement, state transfer taxes and what you agree to cover for the buyer.
- Partial exclusions exist. If you sell early because of a job move, health or other unforeseen circumstances, you may still get part of the exclusion. IRS Publication 523 explains.
- Buying again? See what you can afford with the home affordability calculator.
Questions people ask
Do I pay tax when I sell my house?
Usually not, if it's your main home and your gain is under $250,000 ($500,000 married filing jointly). Rental and investment properties don't get this exclusion.
What about state tax?
Many states tax capital gains as income, often following the federal exclusion. Check your state's rules; this calculator shows federal tax only.
Sources
- IRS: Topic 701, sale of your home
- IRS: Publication 523, selling your home
- IRS: Rev. Proc. 2025-32 (2026 capital gains thresholds)
Reviewed September 28, 2026 by The Dollars World team. How we build and check our calculators · Our data and formulas. This is general information, not financial advice.