Finance & MoneyLast reviewed: November 2026

Home Sale Calculator with Capital Gains

The Home Sale Calculator with Capital Gains determines whether your home sale profit is subject to federal capital gains tax under IRS Section 121. By computing your adjusted cost basis (purchase price + documented capital improvements) and factoring in your 2-out-of-5-year primary residence status, you discover exactly how much profit is shielded tax-free.

Key facts:
  • Section 121 shields $250,000 of gain for single filers and $500,000 for married couples.
  • You must have owned and lived in the home 2 of the last 5 years.
  • The worked example shields the full $246,000 gain — $0 tax.
  • Repairs do not add to cost basis; capital improvements do.

Loading calculator…

Amounts in your selected currency (USD). Enter values in USD — no exchange-rate conversion is applied.

Share or Export Current Results

Share Home Sale Calculator with Capital Gains directly or copy link to clipboard

TwitterLinkedInFacebookWhatsApp

Calculation Formula & Mathematical Engine

Theoretical equation governing this computation.

Taxable Gain = \max\left(0, (P_{sale} - C_{sale}) - (P_{purchase} + C_{improvements}) - E_{sec121}\right)

Variable Definitions

Taxable GainNet profit subject to federal long-term capital gains tax rates ($)
P_{sale}Gross contract sale price ($)
C_{sale}Allowable selling expenses including realtor commissions and title fees ($)
P_{purchase}Original purchase price paid when acquiring the property ($)
C_{improvements}Documented capital improvements that added value or prolonged property life ($)
E_{sec121}IRS Section 121 exclusion: $250,000 for single filers, $500,000 for married couples filing jointly

Step-by-Step Calculation Example

Tax Calculation on a Married Couple Selling a $650,000 Home

Scenario: A married couple bought a house for $320,000, added a $45,000 permitted room addition, paid $39,000 in selling commissions, and lived in the house for 4 years.
Sale Price$650,000
Purchase Price$320,000
Capital Improvements$45,000
Selling Expenses$39,000
Filing StatusMarried Filing Jointly
Execution Steps
  1. 1Calculate adjusted cost basis: $320,000 + $45,000 = $365,000
  2. 2Calculate net realized price: $650,000 - $39,000 = $611,000
  3. 3Determine total capital gain: $611,000 - $365,000 = $246,000
  4. 4Apply Section 121 exclusion: $246,000 gain is below the $500,000 married exclusion threshold
  5. 5Taxable capital gain: $0.00 federal tax owed
Final Verified Output:$0 Taxable Capital Gain ($246,000 100% Tax-Free Profit Shielded by Section 121)

Comprehensive Practical Guide

In-depth analysis, domain guidelines, standard practices, and common pitfalls.

The 2-Out-of-5-Year Primary Residence Rule

To qualify for the Section 121 capital gains exclusion ($250,000 for single taxpayers or $500,000 for married joint filers), you must satisfy both the ownership test and the use test: you must have owned and lived in the residence as your principal home for at least two years (730 days) during the five-year period ending on the date of the sale.

Repairs vs. Capital Improvements: What Counts for Basis

Ordinary repairs (repainting a bedroom, fixing a leaky faucet) do not increase your cost basis. In contrast, capital improvements (installing a new architectural shingle roof, modernizing HVAC, remodeling a kitchen, constructing a composite deck) permanently add property value and increase your adjusted basis, directly reducing future capital gains.

Frequently Asked Questions About Home Sale Calculator with Capital Gains

Direct, verified answers to common calculation and methodology questions.

You can claim the exclusion once every two years, provided you meet the ownership and primary residence tests.
Authoritative Sources & Data References:
  • IRS Publication 523: Selling Your Home
  • Internal Revenue Code Section 121
  • Method: taxable gain = (sale price − selling expenses) − (purchase price + improvements) − Section 121 exclusion, floored at $0.

Disclaimer: Tax laws are subject to legislative changes. Consult a certified public accountant (CPA) for individual tax filing strategy.