How Is Tax Calculated When Selling a House?
Many homeowners start with the sale price when estimating their tax, but the sale price alone does not tell you how much gain you may have. Your adjusted basis and certain selling expenses also matter.
This article explains how tax is calculated when selling a house, including the concepts of gain, adjusted basis, home improvements, selling expenses, and the federal home-sale exclusion.
A simplified house-sale gain calculation is:
The estimated gain is not automatically the amount of tax owed. A qualifying primary residence may receive special federal treatment if applicable requirements are met.
Do You Pay Tax When You Sell a House?
The answer depends on several factors. You may owe tax on the gain from selling a house, but many homeowners can reduce or eliminate their taxable gain through the home-sale exclusion if they meet the requirements.
- Gain β The profit from the sale (sale price minus selling expenses minus adjusted basis).
- Home-sale exclusion β A federal rule that can allow qualifying taxpayers to exclude a portion of their gain from tax.
- Taxable gain β The remaining gain after applying any applicable exclusion.
A qualifying primary residence sale may result in little or no taxable gain.
How Is Gain on a House Sale Calculated?
The gain from selling a house is calculated using a straightforward formula:
Actual tax calculations can involve additional rules, including the home-sale exclusion and state tax considerations.
What Is Cost Basis?
Cost basis is generally the amount you paid for the house, plus certain acquisition costs. Common components include:
- Purchase price β The amount you paid to buy the house.
- Acquisition costs β Certain closing costs, such as title insurance and transfer taxes.
- Settlement fees β Some legal and administrative costs associated with the purchase.
Not every expense associated with purchasing a house automatically becomes part of tax basis. Keep original purchase and closing documents for reference.
What Is Adjusted Basis?
Your adjusted basis can differ from your original purchase price. It reflects adjustments made to your basis over time:
Understanding your adjusted basis is important because it directly affects your gain. A higher adjusted basis means a lower gain, which can reduce your potential tax liability.
Do Home Improvements Increase Basis?
Yes. Qualifying capital improvements can increase your adjusted basis, which reduces your gain. Examples of improvements that may qualify include:
- Additions β Adding a room, deck, or garage.
- Major renovations β Kitchen or bathroom remodels.
- Structural improvements β New roof, siding, or windows.
- Systems upgrades β HVAC, electrical, or plumbing.
Routine repairs and maintenance generally do not increase basis. For more details, see our article on How Do Home Improvements Affect Capital Gains Tax?
Which Selling Expenses May Matter?
Certain selling expenses can reduce the amount realized from the sale, which reduces your gain. Common selling expenses include:
- Real estate commissions β Paid to listing agents and buyer's agents.
- Legal fees β Attorney fees for the closing.
- Closing costs β Title insurance, transfer taxes, and recording fees.
- Advertising costs β Marketing and listing expenses.
Not every closing cost automatically reduces taxable gain. The tax treatment depends on the nature of the expense. For more details, see our article on What Selling Expenses Reduce Capital Gains on a House?
How Does the Primary-Residence Exclusion Work?
The home-sale exclusion is a federal rule that allows qualifying taxpayers to exclude a portion of the gain from the sale of a primary residence.
To qualify, you generally must meet both the ownership and use requirements:
- Ownership β You must have owned the house for at least 2 years (24 months) in the 5-year period before the sale.
- Use β You must have lived in the house as your primary residence for at least 2 years (24 months) in the 5-year period before the sale.
The exclusion is not automatic. Eligibility depends on meeting applicable requirements.
What If You Do Not Qualify for the Full Exclusion?
Some taxpayers may qualify for a reduced or partial exclusion under certain circumstances, such as:
- Certain changes in employment β A new job location that is at least 50 miles farther from the home than the previous work location.
- Health-related circumstances β A doctor's recommendation for a change in residence.
- Certain unforeseen events β Divorce, death, or other qualifying events.
What If the House Was Previously Rented?
If the house was rented at some point, additional tax considerations may apply:
- Depreciation β Depreciation claimed during the rental period reduces your adjusted basis.
- Adjusted basis β Your basis may be lower due to depreciation.
- Depreciation recapture β May apply to the portion of gain attributable to depreciation.
- Exclusion β The home-sale exclusion may still apply, but the portion of gain attributable to depreciation recapture may be treated differently.
Rental use does not automatically disqualify you from the exclusion, but it can affect the calculation. Consult a qualified tax professional for specific guidance.
Worked Example
Let's walk through an example to see how house sale gain is calculated.
Scenario: You sell your house for $600,000 with $30,000 in selling expenses. Your original purchase price was $350,000 with $50,000 in qualifying improvements.
| Step 1: Calculate Amount Realized | |
| Sale Price | $600,000 |
| β Selling Expenses | -$30,000 |
| Amount Realized | $570,000 |
| Step 2: Calculate Adjusted Basis | |
| Purchase Price | $350,000 |
| + Improvements | +$50,000 |
| Adjusted Basis | $400,000 |
| Step 3: Calculate Estimated Gain | |
| Amount Realized | $570,000 |
| β Adjusted Basis | -$400,000 |
| Estimated Gain | $170,000 |
What Records Should You Keep?
Keep these records to support your house sale calculation:
- Original purchase documents β Purchase agreement and closing statement.
- Closing statement β Shows costs and credits in the transaction.
- Improvement invoices β Receipts and permits for qualifying improvements.
- Contractor receipts β Detailed descriptions of work performed.
- Selling expenses β Commissions and other transaction costs.
- Real estate commission records β Commission paid.
- Rental/depreciation records β If the property was rented.
- Previous tax records β Prior returns and depreciation schedules.
- Property documentation β Any other relevant records.
Federal vs State Tax
Federal home-sale rules and state tax rules may differ. State tax treatment varies widely:
- Some states have no capital gains tax (e.g., Texas, Florida, Washington).
- Other states tax capital gains as ordinary income (e.g., California, New York).
- Some states have special rules for home sales.
Do not assume every state follows identical federal treatment. Check your state's current rules or consult a qualified professional.
Common Mistakes
Here are some common mistakes to avoid when estimating tax on a house sale:
- Treating sale price as taxable gain β The sale price is not the gain.
- Forgetting selling expenses β Expenses reduce your amount realized.
- Forgetting improvements β Improvements increase your basis.
- Using the wrong basis β Basis can change over time.
- Assuming the home-sale exclusion automatically applies β You must meet the requirements.
- Ignoring ownership/use requirements β You must meet both requirements.
- Ignoring rental history β Rental use can affect the calculation.
- Ignoring depreciation β Depreciation affects basis.
- Using outdated tax rules β Tax laws can change.
- Ignoring state tax β State tax can add to your liability.
- Losing improvement records β Records support your calculation.
- Confusing capital gain with tax owed β Gain is not the same as tax.
How to Estimate Your House Sale Tax
Before selling your house, use this checklist:
- Sale price β The total amount from the sale.
- Selling expenses β Commissions and closing costs.
- Original basis β Purchase price and acquisition costs.
- Improvement records β Receipts and permits for qualifying improvements.
- Adjusted basis β Calculate your adjusted basis.
- Ownership period β How long did you own the house?
- Use of property β Was it your primary residence?
- Rental history β Was the property ever rented?
- Depreciation history β Was depreciation claimed?
- Potential home-sale exclusion β Check eligibility requirements.
- Federal tax considerations β Review current IRS guidance.
- State tax considerations β Check your state's rules.
For a quick estimate, try our House Sale Tax Calculator.
You may also find these related calculators helpful:
- Home Sale Tax Calculator
- Capital Gains Tax on Home Sale Calculator
- Selling House Capital Gains Calculator
- Property Sale Tax Calculator
Frequently Asked Questions
You may owe tax on the gain from selling your house. However, if you qualify for the home-sale exclusion, you may be able to exclude up to $250,000 (single) or $500,000 (married joint) of gain from federal tax.
Calculate as: Amount Realized β Adjusted Basis = Gain. Amount Realized = Sale Price β Selling Expenses. Adjusted Basis = Purchase Price + Improvements + Other Adjustments β Depreciation.
No. The sale price is the total amount you receive. Taxable gain is the profit (sale price minus selling expenses minus adjusted basis), minus any applicable exclusion.
Adjusted basis is your investment in the house: purchase price + improvements + other adjustments β depreciation. A higher adjusted basis means a lower taxable gain.
Yes. Qualifying capital improvements increase your adjusted basis, which reduces your gain. This is why it's important to keep improvement records.
Yes. Selling expenses such as commissions and closing costs reduce your amount realized, which reduces your gain.
Yes, if you meet the applicable ownership and use requirements. The home-sale exclusion can allow single filers to exclude up to $250,000 and married joint filers up to $500,000 of gain.
You must have owned and lived in the house as your primary residence for at least 2 years (24 months) in the 5-year period before the sale to qualify for the full exclusion.
If the house was rented, depreciation claimed during the rental period reduces your adjusted basis. This can increase your gain. Depreciation recapture may also apply.
Yes. Depreciation reduces your adjusted basis, which increases your gain. If the house was rented, depreciation recapture may also apply.
Yes, in many states. State tax treatment varies widely. Some states have no capital gains tax, while others tax it as ordinary income. Check your state's rules.
Keep: purchase documents, closing statements, improvement receipts, selling expenses, commission records, rental/depreciation records if applicable, and previous tax returns.
Yes. Our House Sale Tax Calculator can help you estimate gain, exclusion, and tax based on the information you provide. Calculators provide estimatesβnot official tax determinations.
No. Capital gain is the profit from the sale. Capital gains tax is the tax you may owe on that gain. The home-sale exclusion and tax rates determine the actual tax.
Read full disclaimer β