Home Sale Tax

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.

⚑ Quick Answer

A simplified house-sale gain calculation is:

Sale Price βˆ’ Selling Expenses βˆ’ Adjusted Basis = Estimated Gain

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.

Important: The final tax result depends on the taxpayer's circumstances, including eligibility for the home-sale exclusion and applicable federal and state rules.

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.

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:

Amount Realized βˆ’ Adjusted Basis = Estimated Gain
Amount Realized = Sale Price βˆ’ Applicable Selling Expenses
Adjusted Basis = Original Basis + Qualifying Improvements + Applicable Adjustments

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:

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:

Adjusted Basis = Original Basis + Improvements βˆ’ Depreciation + Other Adjustments

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:

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:

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.

General framework: If you meet the applicable ownership and use requirements, you may be able to exclude up to $250,000 (single) or $500,000 (married joint) of gain from federal income tax.

To qualify, you generally must meet both the ownership and use requirements:

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:

Important: These special circumstances have specific conditions and limitations. This article does not provide an exhaustive list. Consult current IRS guidance or a qualified tax professional for details.

What If the House Was Previously Rented?

If the house was rented at some point, additional tax considerations may apply:

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.

πŸ“Š Example: Selling a House

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 this means: The $170,000 is the estimated gain before considering any applicable exclusion or other tax rules. It is NOT automatically the final taxable gain. It is also NOT the amount of tax owed.

What Records Should You Keep?

Keep these records to support your house sale calculation:

Federal vs State Tax

Federal home-sale rules and state tax rules may differ. State tax treatment varies widely:

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:

How to Estimate Your House Sale Tax

Before selling your house, use this checklist:

For a quick estimate, try our House Sale Tax Calculator.

House Sale Tax Calculator
Estimate gain, home-sale exclusion, and tax when selling your house.
Try Calculator β†’

You may also find these related calculators helpful:

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.

SB
Written by Shabnam Bano
Last Updated: August 15, 2026
Tax Year: 2026
Disclaimer: This article is for educational and informational purposes only and is not tax, legal or financial advice. Tax treatment depends on individual circumstances, applicable federal and state rules, and current tax law. Consider consulting a qualified tax professional for advice about your specific situation.

Read full disclaimer β†’