Selling your house for more than you paid does not automatically create a large tax bill. The capital gains tax on the sale of a home often applies only after several adjustments and exclusions. Many qualifying homeowners can exclude up to $250,000 or $500,000 of gain from federal income tax.
Direct answer: According to IRS Topic No. 701, you may exclude up to $250,000 of gain from the sale of your main home, or up to $500,000 on a joint return. You must also have owned and used the home as your main home for at least two of the five years before the sale. You generally must satisfy ownership, residence, and prior-exclusion requirements before claiming the full benefit.
The amount you receive at closing is also not your taxable gain. Your purchase basis, qualifying improvements, selling expenses, and available exclusion can substantially reduce taxable profit. Understanding those figures before listing your home can prevent an unwelcome tax surprise.
Home Sale Capital Gains at a Glance
| Question | General federal rule |
|---|---|
| Maximum exclusion for many single filers | Up to $250,000 of qualifying gain |
| Maximum exclusion for many joint filers | Up to $500,000 of qualifying gain |
| Basic ownership requirement | Own the home for at least two of the previous five years |
| Basic residence requirement | Use it as your main home for at least two of the previous five years |
| Prior exclusion rule | Generally cannot claim another home-sale exclusion within the previous two years |
| Long-term federal rates | Usually 0%, 15%, or 20%, depending on taxable income |
| Personal-home loss deductible? | Generally no |
| Rental or business use | Special rules can make part of the gain taxable |
Key Takeaways
- Tax normally applies to gain, not the home’s full sale price.
- Many homeowners qualify for a $250,000 or $500,000 Section 121 exclusion.
- Capital improvements can increase basis and reduce your calculated gain.
- Selling expenses can reduce the amount realized from the transaction.
- Rental history and depreciation can create taxable amounts despite the exclusion.
- State income taxes may apply separately from federal rules.
How Capital Gains Tax on Sale of Home Is Calculated
Your first step is calculating the gain rather than looking at your sale proceeds. Start with the amount realized after qualifying selling expenses. Then subtract your adjusted tax basis from that figure.
A simplified calculation looks like this:
Sale price − eligible selling expenses − adjusted basis = realized gain
Your adjusted basis usually begins with what you paid for the property. Certain purchase costs and later capital improvements can increase that basis. Some items, including depreciation previously allowed, can reduce it.
Suppose you bought a home for $350,000 and later spent $70,000 on qualifying improvements. Your adjusted basis could reach $420,000 before other adjustments. Selling for $700,000 with $40,000 of selling expenses would produce a $240,000 gain.
For a qualifying single homeowner, that entire $240,000 might fall under the federal exclusion. The result could be no federal tax on that gain. Your actual calculation can differ because basis rules depend on your specific records.
Who Qualifies for the Home Sale Exclusion?
The IRS generally requires both an ownership test and a residence test. You usually must own the property for two years during the five years before sale. You must also use it as your main home for two years during that period.
Those two years do not always need to be continuous. Ownership and residence periods also do not always have to match exactly. Special rules apply to married couples, surviving spouses, military members, divorced owners, and several other situations.
You generally cannot use the exclusion repeatedly within short periods. The IRS normally requires that you did not claim the exclusion on another home within two years. This rule prevents routine use of the benefit for frequent property sales.
For married couples filing jointly, the $500,000 maximum has additional requirements. Both spouses generally must satisfy the residence and look-back requirements. At least one spouse generally must satisfy the ownership requirement.
What Counts as a Capital Improvement?

Capital improvements can matter because they may increase your home’s adjusted basis. A higher basis can reduce the gain produced by your sale. Keeping invoices and closing documents can therefore save money later. If you are weighing a big project, our average cost of a kitchen remodel guide shows what such work typically runs.
Common qualifying improvements can include the following.
- Adding a bedroom, bathroom, deck, or garage.
- Installing a new roof or permanent siding.
- Remodeling a kitchen as a lasting improvement.
- Installing central air conditioning.
- Replacing major plumbing or electrical systems.
- Building a pool, fence, driveway, or retaining wall.
- Installing certain permanent energy systems.
Ordinary maintenance usually does not receive the same treatment. Painting, fixing a small leak, or replacing broken hardware normally maintains existing condition. Those expenses generally do not increase basis by themselves.
There can be exceptions when repair work forms part of a larger renovation. Replacing damaged items during a substantial remodeling project may qualify differently. Good records help establish why each expense should affect basis.
What Selling Costs Can Reduce Your Gain?
The sale price is not always the amount used to determine your gain. Certain expenses paid to complete the sale reduce the amount realized. That can lower the taxable result.
Examples may include real estate commissions and certain transfer-related selling expenses. Other costs directly connected with completing the sale can also qualify. The exact treatment depends on what the charge represents. More from us: Wholesaling Real Estate.
Do not subtract your remaining mortgage balance when calculating gain. Paying off a mortgage affects the cash you receive at closing. It generally does not determine how much taxable gain you earned.
That distinction confuses many sellers. A homeowner can receive little cash after paying the mortgage yet still have a significant gain. Another homeowner can receive substantial cash while having little taxable profit.
What Federal Tax Rate Applies to Taxable Home-Sale Gain?
A home held longer than one year generally produces long-term capital gain treatment. Federal long-term rates are commonly 0%, 15%, or 20%. Your taxable income and filing status determine where taxable gain falls.
The 0% rate applies at lower taxable incomes, and the 20% rate applies only at the highest incomes. The exact income thresholds change each year, so check the current IRS figures for your filing status.
The $250,000 or $500,000 exclusion comes before tax applies to eligible gain. Only gain remaining after the exclusion enters the normal tax calculation. Other income can still influence the rate applied to that remaining amount.
Higher-income sellers should also consider the 3.8% Net Investment Income Tax. The tax does not apply to home-sale gain excluded under Section 121. Taxable gain above the exclusion can potentially enter the NIIT calculation.
Can You Get a Partial Exclusion?
Failing the full two-year requirements does not always mean losing the entire exclusion. A reduced exclusion may apply when the main reason for selling involves qualifying circumstances. IRS rules recognize several employment, health, and unforeseen-event situations.
A qualifying work move can sometimes support a partial exclusion. Certain health-related moves can qualify as well. Death, divorce, multiple births, job changes, and other qualifying events can also matter.
The reduced amount generally reflects the portion of the two-year requirement you satisfied. The IRS provides a worksheet for calculating that amount. Sellers with borderline facts should consider professional tax advice before assuming they qualify.
What Happens If You Rented the Home?
Rental use can make the calculation more complicated. You might still satisfy the residence test after renting a former main home. Yet depreciation and periods of nonqualified use can create taxable gain.
Depreciation allowed or allowable for rental or business use after May 6, 1997 receives special treatment. That portion generally cannot be excluded through the home-sale exclusion. You may owe tax even when the remaining gain is fully covered.
Timing also matters when a former residence becomes a rental property. Certain post-2008 periods of nonqualified use can limit the available exclusion. Exceptions exist, so the sequence of personal and rental use matters.
A home office inside your dwelling can create a smaller version of this issue. Gain tied to allowable depreciation may remain taxable. Separate rental units or detached business areas can involve additional allocation rules.
What If You Sell a Second Home?
The Section 121 benefit generally focuses on your principal residence. A vacation home or second home does not automatically qualify. Simply owning a property for several years is not enough.
You may sometimes convert a second home into your primary residence. That does not guarantee that every dollar of later gain becomes excludable. Nonqualified-use rules can allocate part of the appreciation to taxable periods.
Investment property follows different rules from a personal residence. Rental income, depreciation, and business-use rules can affect the result. Consider getting tax advice before changing how a property is used.
Do You Have to Report the Sale?
Not every qualifying home sale creates a federal reporting requirement. If all gain qualifies for exclusion, reporting may not always be necessary. Receiving Form 1099-S can change that requirement.
The IRS generally requires reporting when you cannot exclude all taxable gain. You may use Form 8949 and Schedule D in those situations. Business or rental elements can require additional forms.
Keep your closing disclosure and purchase records after the sale. Save receipts for qualifying improvements and documentation supporting your residence period. These records can support both the gain calculation and exclusion.
State Taxes Can Change the Result
Federal treatment is only one part of your total tax picture. States can impose their own income-tax rules on real estate gains. Some states do not follow every federal exclusion rule identically.
Your property’s location can also matter after you move elsewhere. A state may still tax gain connected with real property located there. Residency rules do not always eliminate tax on an in-state property sale. If you are planning where to move next, see the most affordable places to live in the US.
Check your state’s current rules before estimating your final proceeds. A federal exclusion does not guarantee a zero state tax bill. A tax professional can model both amounts before closing.
Example: Calculating Taxable Gain Before Closing
Consider a married couple who bought their primary residence for $500,000. They later completed $100,000 of qualifying capital improvements. Their adjusted basis is $600,000 before any other required adjustments.
They sell the property for $1,200,000 and incur $60,000 of qualifying selling expenses. Their amount realized becomes $1,140,000. Subtracting the $600,000 basis produces a $540,000 realized gain.
Assume they qualify for the full $500,000 joint exclusion. Only $40,000 remains potentially taxable at the federal level. Their final tax depends on income, other gains, deductions, and any special rules.
This example shows why the sale price alone tells you little. Basis records and selling costs can change the result by thousands of dollars. Calculating those figures early makes planning far easier.
How to Prepare Before Selling
Start collecting tax records before your house reaches the market. Older receipts may become difficult to locate after a move. Rebuilding years of improvement history can also produce avoidable uncertainty. Your original closing statement matters most, and our guide on how much it costs to buy a house explains which purchase costs appear there.
Gather these records before you list.
- Original purchase closing documents.
- Records of major capital improvements.
- Previous depreciation schedules, when applicable.
- Documents showing rental or business use.
- Prior home-sale exclusion information.
- Current selling-cost estimates.
- Any Form 1099-S received after closing.
Estimate your adjusted basis before accepting an offer. Then compare your likely gain with the available exclusion. Sellers with rental history or large appreciation should seek tax guidance earlier.
Frequently Asked Questions
Do I owe capital gains tax on sale of home profits?
You may owe tax if your gain exceeds your available exclusion. You can also owe tax when special rental or depreciation rules apply. Many qualifying homeowners owe no federal tax because their gain stays below the exclusion.
Is the $250,000 exclusion based on the sale price?
No, the exclusion applies to qualifying gain rather than the full selling price. Gain starts with the amount realized minus adjusted basis. This distinction can dramatically reduce the amount considered for tax.
Do I have to buy another house to avoid tax?
No, federal law does not generally require you to purchase a replacement residence. That older concept no longer controls the standard Section 121 exclusion. Eligibility centers primarily on ownership, residence, and related requirements.
Can I deduct a loss when selling my main home?
Generally, no. A loss from selling property held for personal use is not deductible. Different rules can apply if you convert the property to qualifying business or rental use.
Does paying off my mortgage reduce my taxable gain?
No, your remaining mortgage usually does not reduce the gain calculation. It affects the cash proceeds you receive after closing. Taxable gain depends mainly on amount realized, adjusted basis, and available exclusions.
Should I speak with a tax professional before selling?
Professional advice can be useful when your gain approaches the exclusion limit. It is especially helpful for rentals, home offices, divorce, inheritance, or multiple residences. Early planning can also help identify missing basis records before closing.
Plan the Tax Side Before You List
A profitable home sale does not automatically mean a large federal tax payment. The Section 121 exclusion protects substantial gain for many qualifying homeowners. Accurate basis records can further reduce the remaining taxable amount.
Calculate your estimated gain before setting expectations for your net proceeds. Review ownership, residence, rental history, and improvement records at the same time. That gives you a clearer financial picture before accepting an offer.
Tax rules can change, and individual circumstances can alter the calculation. Confirm your position with current IRS guidance or a qualified tax adviser. Then you can approach closing with fewer financial surprises.




