US versionOther versions: France (in French) · Belgium (in French) · Switzerland (in French) · England
Buying and Selling a Home
Do you pay capital gains tax when you sell your home?
The sale price is not the same thing as your taxable gain.
The answer in 2 lines. You may owe federal tax on a gain when you sell a home, but a qualifying sale of your main home can be partly or fully excluded. The IRS's 2025 Publication 523 describes an exclusion of up to $250,000 for an eligible individual, or up to $500,000 for an eligible married couple filing jointly. Calculate gain using your adjusted basis and allowable selling expenses, then check the ownership, residence and prior-exclusion rules. State and local tax treatment can differ, so check your state tax agency too.
Start with your gain, not the check you receive
- Gather the purchase and sale closing statements, records of capital improvements and any records of rental or business use.
- Use Worksheet 2 in IRS Publication 523, Selling Your Home to calculate adjusted basis and gain or loss. The calculation accounts for eligible selling expenses and basis adjustments; paying off a mortgage is not itself a selling expense that reduces gain.
- Use the publication's eligibility test and Worksheets 1 and 3 to determine the exclusion and any taxable gain. Keep the supporting records with your tax documents.
A capital improvement may increase basis; ordinary maintenance generally does not. The IRS worksheets explain which costs and adjustments to include. A loss on the sale of a personal residence generally is not deductible.
Good to know
- For the full federal exclusion, the general rule is that you owned the home for at least two years and used it as your main home for at least two years during the five years before the sale. The periods do not have to be the same.
- Generally, you cannot claim the exclusion if you claimed it for another home sale during the two years before this sale. Publication 523 explains exceptions and special situations.
- For the higher married-filing-jointly limit, either spouse generally must satisfy the ownership test, while both must satisfy the residence test. The other eligibility conditions also apply.
What if you moved early or rented the home?
A qualifying work-related move, health reason or certain unforeseen circumstances may allow a partial exclusion even if you do not meet the usual time requirements. Work through the partial-exclusion section of Publication 523; an early sale does not automatically qualify.
Rental or business use can complicate the calculation. In particular, depreciation allowed or allowable for certain periods cannot be excluded as home-sale gain. Use the publication's business and rental sections and consider a qualified tax professional if your records involve depreciation, a former rental or another complicated situation.
A seller has lived in and owned a main home long enough to meet the general tests and has not claimed the exclusion on another sale during the relevant period. The seller gathers the purchase statement, improvement receipts and sale statement, then uses the IRS worksheets. The amount left after paying off the mortgage is useful for budgeting, but it is not the worksheet's taxable-gain calculation.
A made-up story, for illustration.
Check reporting and state tax
- Read the reporting section of IRS Publication 523 even if you expect the entire gain to be excluded. For example, receiving Form 1099-S can trigger a federal reporting requirement.
- Use the state tax agency link on https://www.usa.gov/state-taxes to select your state and check its treatment of the sale and its filing instructions. Federal exclusion rules do not automatically answer the state question.
- If you choose a tax professional, ask about experience with home sales and rental use, agree on fees and scope in writing, and verify credentials using the IRS resource linked below.
Choosing tax help
The IRS home-sale tax topic summarizes federal eligibility and reporting. For paid help, use the IRS's guide to choosing a tax professional to check qualifications and responsibilities. Bring your calculations and records, and review the return before signing it.
What not to do
- Treating the full sale price or the mortgage payoff as the taxable gain.
- Assuming a sale of a vacation home qualifies under the main-home rules.
- Discarding improvement and rental records before calculating adjusted basis and depreciation.
- Assuming no return entry is needed solely because you expect no federal tax.
Read more guides
Bobby publishes free practical guides written for the United States: American laws, numbers and organizations. In the United States, Bobby answers your questions; it does not put you in touch with professionals.
All guides: United StatesSources, verification, confidence
Verified on November 24, 2026, for the United States. Confidence: high for the federal rules described in the IRS's 2025 publication; medium for an individual result, which depends on facts and state law.