This capital gains tax on home sale calculator estimates the federal tax you'll owe when you sell your main home in the US. Enter the selling price, your selling expenses and your adjusted basis, and it works out your gain, applies the $250,000 or $500,000 home sale exclusion if you qualify, and taxes anything left at the 2026 capital gains rates, including the 3.8% net investment income tax where it applies.
How to use the capital gains tax on home sale calculator
- Choose your filing status.
- Enter the selling price and your selling expenses, such as agent commissions.
- Enter your adjusted basis: what you paid for the home plus the cost of improvements.
- Add your other taxable income for the year, which sets your capital gains rate.
- Tick the boxes if you meet the 2-out-of-5-year tests and owned the home for more than a year, then press Calculate.
Working out the gain
To figure the gain or loss on selling your main home, you need the selling price, the amount realized and the adjusted basis. The amount realized is the selling price minus selling expenses. Subtract the adjusted basis from the amount realized to get your gain or loss: a positive number is a gain, a negative number a loss. Your basis is generally what the home cost you, and events during your ownership, such as improvements or using the home for business, can change it.
The $250,000 and $500,000 exclusion
If you have a capital gain from selling your main home, you may qualify to exclude up to $250,000 of it from your income, or up to $500,000 if you file a joint return with your spouse. To qualify you generally need to meet two tests. The ownership test: you owned the home for at least 24 months of the 5 years before the sale. The use test: you lived in it as your residence for at least 24 months of those 5 years. The two periods don't have to be the same, but both must fall within the 5 years ending on the date of the sale. On a joint return, either spouse can meet the ownership test, but both must meet the use test. You generally can't use the exclusion if you excluded a gain on another home in the two years before this sale.
Tax on the rest of the gain
Any gain above the exclusion is a capital gain. If you owned the home for more than a year, it's long-term and taxed at 0%, 15% or 20% depending on your total taxable income: in 2026 the 15% rate starts above $49,450 for single filers and $98,900 for married couples filing jointly, and 20% starts above $545,500 and $613,700. Higher earners may also owe the 3.8% net investment income tax on the taxable part of the gain, when their income is above $200,000 (single) or $250,000 (joint).
Worked example
Say a married couple filing jointly sells their home for $900,000, pays $50,000 in selling expenses and has an adjusted basis of $300,000. The amount realized is $850,000 and the gain is $550,000. They've lived there for years, so $500,000 is excluded, leaving a taxable gain of $50,000. With $150,000 of other taxable income, that gain falls in the 15% band, so the federal tax is about $7,500. A single person with the same sale and income could exclude only $250,000, leaving $300,000 taxed: about $45,000 of capital gains tax plus $9,500 of net investment income tax, about $54,500.
When you don't qualify
If you haven't owned and lived in the home for two of the last five years, untick the first box and the whole gain is taxed. Publication 523 explains partial exclusions for moves because of work, health or unforeseeable events, which this calculator doesn't model. Members of the Uniformed Services, the Foreign Service or the intelligence community on qualified official extended duty can choose to suspend the 5-year test period for up to 10 years.
Reporting the sale
If you receive Form 1099-S for the sale, you must report it even if the whole gain is excluded, and you must report it whenever you can't exclude all of the gain. Use Schedule D and Form 8949 when required. A loss on the sale of your main home isn't deductible.
What goes into your adjusted basis
Your basis usually starts with what you paid for the home, including certain settlement or closing costs you paid when you bought it. If you built the home, it starts with the cost of the land and of building it. Improvements you make while you own the home are added to the basis. An improvement is work that adds to the value of the home, extends its useful life or adapts it to new uses, such as an addition, a new roof, central air conditioning, a new heating system or a remodelled kitchen. Ordinary repairs that only keep the home in good condition, like fixing a leak or repainting a room, aren't improvements and don't change your basis. Some events lower your basis, such as deductible casualty losses or depreciation you claimed for a home office or rental use.
What counts as a selling expense
Selling expenses are the costs of getting the home sold. They typically include real estate agent commissions, advertising, legal fees, title fees, and transfer or stamp taxes that the seller pays. Because they reduce the amount realized, they reduce your gain directly, so it's worth adding them up from your closing statement before you use the calculator.
Common mistakes
- Forgetting improvements. They increase your basis and lower your gain.
- Leaving out selling expenses. They reduce the amount realized.
- Assuming the exclusion is automatic. You must meet both the ownership and use tests.
- Ignoring the two-year rule. A recent exclusion on another home can block this one.
Tips
- Keep records of improvements for as long as you own the home.
- Check the dates you lived in the home before choosing a sale date.
- Read Publication 523 if you rented the home out or used part of it for business.
What next
- United States Capital Gains Tax Calculator
- Property Tax Calculator
- United States Income Tax Calculator
Use this often? Add Capital Gain to your Home screen.
Frequently asked questions
How much tax will I pay on the sale of my home?
Often none: up to $250,000 of gain ($500,000 on a joint return) is excluded if you meet the ownership and use tests. Any gain above that is taxed at 0%, 15% or 20%.
How is the gain on a home sale calculated?
Selling price minus selling expenses gives the amount realized; subtract your adjusted basis to get the gain.
What are the ownership and use tests?
You must have owned the home and lived in it as your residence for at least 24 months each during the 5 years before the sale.
Does the capital gains tax on home sale calculator include the 3.8% NIIT?
Yes, on the taxable part of the gain, when your income is above $200,000 (single) or $250,000 (joint).
Can I deduct a loss on selling my home?
No. A loss on the sale of your main home isn't deductible.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.