Real Estate Capital Gains Tax Calculator 2026
Calculate your real estate capital gains tax on investment property and home sales. Includes depreciation recapture at 25%, 1031 exchange guidance, and primary residence exclusion.
Purchase Information
Sale Information
Property Adjustments
Capital improvements that add value (not repairs)
Total depreciation claimed on the property (taxed at 25%)
Tax Filing Information
Your income from other sources (excluding this gain)
Capital Gains Tax on Investment Property
Cost Basis Formula
Purchase Price
$300,000
Improvements
$50,000
Depreciation
$80,000
Adjusted Basis
$270,000
≤ 1 Year
Short-term: taxed at ordinary income rates (10%–37%)
> 1 Year
Long-term: preferential rates of 0%, 15%, or 20%
25%
Depreciation recapture rate on prior deductions
Investment Property Tax Basics
Investment properties—including rental homes, apartment buildings, commercial real estate, and vacant land—are subject to capital gains tax when sold for a profit. However, the tax calculation for real estate is more complex than for stocks or other assets because it involves several additional factors that can significantly affect your final tax bill.
Understanding these factors is essential for any real estate investor looking to accurately estimate their tax liability and plan their investment exit strategy effectively.
Determining Your Adjusted Cost Basis
The first step in calculating capital gains tax on investment property is determining your adjusted cost basis. Your adjusted basis starts with the original purchase price of the property and is then modified by several factors. Capital improvements—such as adding a new room, replacing the roof, or installing central air conditioning—increase your basis because they add value to the property or extend its useful life.
Conversely, depreciation deductions that you have claimed over the years reduce your basis. This is a crucial concept because a lower basis means a higher taxable gain when you sell. For example, if you purchased a rental property for $300,000, made $50,000 in capital improvements, and claimed $80,000 in depreciation over the years, your adjusted basis would be $270,000 ($300,000 + $50,000 - $80,000).
Key takeaway: A lower adjusted basis means a higher taxable gain. Track every capital improvement and keep detailed depreciation records to minimize your tax liability.
Holding Period & Depreciation Recapture
The holding period for investment property follows the same rules as other capital assets. If you hold the property for more than one year, any gain qualifies for the preferential long-term capital gains rates of 0%, 15%, or 20%. However, this is where real estate diverges from other assets: the portion of your gain attributable to prior depreciation deductions is subject to depreciation recapture at a flat 25% rate, known as the unrecaptured Section 1250 gain.
This means that if you have significant accumulated depreciation, your effective tax rate on the total gain may be higher than the standard long-term capital gains rate. Only the gain that exceeds the recaptured depreciation amount benefits from the lower 0%/15%/20% rates.
Selling & Purchase Cost Adjustments
Selling costs can also reduce your taxable gain. Real estate agent commissions, title insurance, escrow fees, transfer taxes, and other closing costs associated with the sale are subtracted from the sale price to determine your net proceeds. Similarly, certain selling expenses like advertising and legal fees may also reduce your gain.
On the purchase side, closing costs such as title insurance, legal fees, and transfer taxes can be added to your cost basis. Keeping detailed records of all purchase and selling costs is essential for minimizing your tax liability. A well-documented paper trail can save you thousands of dollars by ensuring you take advantage of every legitimate basis adjustment available to you.
High Tax Impact for Portfolio Investors
For investors with significant real estate portfolios, the total tax impact can be substantial. A high-income investor in California selling a rental property with a $500,000 gain could face a combined federal and state tax rate exceeding 40% when depreciation recapture, NIIT, and state taxes are all factored in.
This makes tax planning strategies like 1031 exchanges and tax-loss harvesting especially important for real estate investors. Our calculator above accounts for all of these factors—adjusted basis, depreciation recapture, capital gains rates, and NIIT—to give you an accurate estimate of your federal tax liability.
Primary Residence Exclusion ($250K/$500K)
$250,000
Exclusion for Single Filers
Single taxpayers and those filing as head of household can exclude up to $250,000 in capital gains from the sale of their primary residence.
$500,000
Exclusion for Married Filing Jointly
Married couples filing jointly can exclude up to $500,000 in capital gains, provided both spouses meet the ownership and use requirements.
Qualification Checklist
Ownership Test
You must have owned the home for at least 2 of the 5 years immediately preceding the sale date
Use Test
You must have lived in the home as your principal residence for at least 2 of those 5 years
Frequency Limit
You can only use this exclusion once every two years—not on multiple sales within that period
Spouse Rule (Married Filing Jointly)
Both spouses must meet the use test, but only one spouse needs to meet the ownership test for the $500,000 exclusion
Partial Exclusion Available
If you don't meet the full 2-year requirement, a prorated exclusion may apply if the sale was due to employment change, health, or unforeseen circumstances
Section 121: A Generous Tax Benefit
The primary residence exclusion, codified in Section 121 of the Internal Revenue Code, is one of the most generous tax benefits available to American homeowners. This provision allows you to exclude a significant amount of capital gains from taxation when you sell your primary residence, potentially saving you tens of thousands of dollars in taxes.
To qualify for the full exclusion, you must meet two tests: the ownership test and the use test. The ownership test requires that you owned the home for at least two of the five years immediately preceding the date of sale. The use test requires that you lived in the home as your principal residence for at least two of those same five years.
Non-Continuous Periods Count
Importantly, the two years of ownership and use do not need to be continuous. You can own and live in the home for separate periods that total at least 24 months within the five-year window. For example, if you owned a home for three years but rented it out for one of those years while you lived elsewhere, you would still meet the two-year use test if you lived in the home for the other two years.
The exclusion can be used once every two years, meaning you cannot claim it on multiple home sales within a two-year period. Both spouses in a married couple must meet the use test, but only one spouse needs to meet the ownership test for the $500,000 joint exclusion.
Partial Exclusion: Safe Harbor Reasons
If you do not meet the full two-year requirement, you may still qualify for a partial exclusion if the sale was due to certain unforeseen circumstances. The IRS recognizes several safe harbor reasons for a partial exclusion, including a change in employment location (if the new job is at least 50 miles farther from the old home than the old workplace), health reasons (including the need to obtain medical care or to live in a healthier climate on the advice of a physician), or unforeseen circumstances such as divorce, death of a spouse, multiple births from the same pregnancy, or natural or man-made disasters.
The partial exclusion is prorated based on the fraction of the two-year requirement that you did meet.
Non-Qualified Use Rules
It is important to note that the Taxpayer Relief Act of 1997 replaced the previous one-time rollover provision with the current exclusion, which can be used repeatedly as long as you meet the requirements. However, if you converted your primary residence to a rental property and later moved back in before selling, the IRS applies special rules for periods of non-qualified use.
Any period after December 31, 2008, during which the property was not used as your principal residence is considered non-qualified use, and the gain attributable to that period cannot be excluded. This proration rule prevents taxpayers from renting out their home for years and then moving back in briefly to claim the full exclusion. For more details on home sale tax implications, visit our home sale tax guide.
1031 Exchange for Real Estate
1031 Exchange Timeline
Day 0
Sell Property
Close on relinquished property
Day 45
Identify Replacement
Must identify in writing
Day 180
Close on Replacement
Must complete the purchase
Both deadlines are firm and cannot be extended, even if they fall on weekends or holidays.
1031 Exchange Rules
Like-Kind: Any real property held for investment qualifies as like-kind to any other investment real estate
Qualified Intermediary: A QI must hold proceeds between transactions—no direct access to funds
Equal or Greater Value: Replacement must equal or exceed the relinquished property value to defer all tax
Boot is Taxable: Any cash or property received ("boot") in the exchange is immediately taxable
3-Property Rule: Identify up to 3 properties of any value, or more if combined value ≤ 200% of sold property
Unlimited Use: No limit on how many times you can use a 1031 exchange—defer taxes indefinitely
Powerful Tax Deferral Strategy
A 1031 exchange, named after Section 1031 of the Internal Revenue Code, is one of the most powerful tax deferral strategies available to real estate investors. This provision allows you to sell an investment property and defer paying capital gains tax by reinvesting the proceeds into a like-kind replacement property.
The term "like-kind" is broadly interpreted for real estate—virtually any type of real property held for investment or business purposes qualifies as like-kind to any other real property held for investment or business purposes. This means you can exchange a rental condo for a commercial office building, a vacant lot for an apartment complex, or any other combination of investment real estate.
Strict Timelines & Rules
The 1031 exchange process is governed by strict timelines and rules that must be followed precisely to qualify for tax deferral. After selling your relinquished property, you have exactly 45 calendar days to identify potential replacement properties in writing. You can identify up to three properties of any value (the three-property rule), or more than three properties as long as their combined value does not exceed 200% of the sold property's value (the 200% rule).
After identification, you must close on the replacement property within 180 calendar days of selling the relinquished property, or by the due date of your tax return for the year of the sale, whichever is earlier. Both deadlines are firm and cannot be extended, even if they fall on weekends or holidays.
Qualified Intermediary & Boot Requirements
Several additional requirements apply to a valid 1031 exchange. You must use a qualified intermediary (QI) to facilitate the exchange—the QI holds the proceeds from the sale and transfers them directly to the seller of the replacement property. You cannot have direct access to the funds between transactions, or the exchange will be disqualified and all taxes become immediately due.
To defer the entire tax liability, the replacement property must be of equal or greater value than the relinquished property, and you must reinvest all of the proceeds from the sale. If you receive any cash or other property (known as "boot") in the exchange, that amount is taxable. There is no limit on how many times you can use a 1031 exchange, and some investors use successive exchanges to defer taxes indefinitely, passing the property to heirs at a stepped-up basis upon death. For comprehensive guidance on the 1031 exchange process, visit our dedicated 1031 exchange guide.
Depreciation Recapture Explained
Depreciation Recapture Rate: 25%
The portion of your gain attributable to previously claimed depreciation is taxed at a flat 25% rate (unrecaptured Section 1250 gain), regardless of your ordinary income bracket or long-term capital gains rate. This rate applies even if your long-term capital gains rate would be 0%, 15%, or 20%.
Recapture Example: Step by Step
Purchase Price
$400,000
$300K building + $100K land
Depreciation Claimed (10 years)
$109,000
$300K ÷ 27.5 yrs × 10 yrs
Capital Improvements
$30,000
Adjusted Basis
$321,000
$400K + $30K − $109K
Sale Price
$600,000
Total Gain
$279,000 ($600K − $321K)
Recapture Portion @ 25%
$109,000 → Tax: $27,250
Remaining Gain @ 0%/15%/20%
$170,000 → Rate varies by income
How Depreciation Recapture Works
Depreciation recapture is one of the most commonly misunderstood aspects of real estate taxation, yet it can have a significant impact on your tax bill when you sell a rental or investment property. When you own a rental property, the IRS allows you to deduct a portion of the property's cost each year as a depreciation expense, which reduces your taxable rental income.
For residential rental property, the depreciation period is 27.5 years, meaning you can deduct approximately 3.636% of the property's basis (excluding land) each year. For commercial property, the depreciation period is 39 years. While these deductions provide valuable tax savings during the holding period, they come with a catch: when you sell the property, the IRS requires you to "recapture" those deductions by taxing a portion of your gain at a higher rate.
The 25% Recapture Rate
The mechanics of depreciation recapture work as follows. When you sell the property, you first calculate your total gain by subtracting your adjusted basis from the net sale price. Your adjusted basis equals the original purchase price plus capital improvements minus accumulated depreciation.
The portion of your total gain that is attributable to the depreciation you previously claimed is called unrecaptured Section 1250 gain, and it is taxed at a maximum rate of 25%. This 25% rate applies regardless of your ordinary income tax bracket or what your long-term capital gains rate would otherwise be. Even if you are in the 0% long-term capital gains bracket, the depreciation recapture portion is still taxed at up to 25%.
Concrete example: A $400K rental (10 years of depreciation) sold for $600K produces a $279K total gain—$109K taxed at 25% recapture rate and $170K at long-term capital gains rates.
Recapture Example Breakdown
Here is a concrete example to illustrate how depreciation recapture works. Suppose you purchased a rental property for $400,000 (with $300,000 allocated to the building and $100,000 to the land). Over 10 years, you claimed approximately $109,000 in depreciation ($300,000 divided by 27.5 years, times 10 years). You also made $30,000 in capital improvements.
Your adjusted basis is now $321,000 ($400,000 + $30,000 - $109,000). If you sell the property for $600,000, your total gain is $279,000 ($600,000 - $321,000). Of this gain, $109,000 is subject to depreciation recapture at 25% (tax of $27,250), and the remaining $170,000 is subject to long-term capital gains rates of 0%, 15%, or 20% depending on your income level.
Allowed or Allowable Rule
It is important to note that you must recapture depreciation even if you did not actually claim it on your tax return. The IRS requires recapture of "allowed or allowable" depreciation, meaning that if you could have claimed depreciation but chose not to, you still must recapture it upon sale.
This makes it almost always advantageous to claim depreciation deductions while you own the property—if you are going to be taxed on the recapture anyway, you might as well benefit from the deductions during the holding period. If you are facing a significant depreciation recapture tax, a 1031 exchange can defer both the capital gains tax and the depreciation recapture tax by allowing you to roll the entire gain into a replacement property.
State Real Estate Capital Gains Tax
9 States
0% State Capital Gains Tax
AK, FL, NV, NH, SD, TN, TX, WA, WY
Only federal capital gains tax applies
CA: 13.3%
Highest State Rate on Capital Gains
Combined federal + state rate can exceed 37%
Even higher on depreciation recapture
NY: up to 8.82%
+ NYC tax up to 3.876% for residents
NJ: up to 10.75%
High-income surtax applies
HI: up to 11%
Second-highest state rate
State Tax on Real Estate Gains
In addition to federal capital gains tax, most states impose their own income tax on capital gains from real estate sales. The state where the property is located has the primary right to tax the gain, regardless of where you currently reside. This means that if you live in a state with no income tax like Florida but sell an investment property in California, you will still owe California state tax on the gain.
You may also owe tax in your home state, though most states offer a credit for taxes paid to other states to prevent double taxation.
State Rate Variations
State capital gains tax rates on real estate vary enormously across the country. Nine states—Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming—have no state income tax, meaning you only pay federal capital gains tax on real estate gains.
At the other extreme, California taxes capital gains as ordinary income at rates up to 13.3%, and New York combines state tax (up to 8.82%) with potential New York City tax (up to 3.876%) for residents of the five boroughs. When you combine federal and state taxes, a high-income California resident could pay an effective rate of over 37% on long-term real estate gains and even more on depreciation recapture.
Special State Provisions
Some states offer special treatment for real estate gains that can reduce your state tax liability. For example, some states conform to the federal Section 121 primary residence exclusion, while others have their own provisions. A few states offer reduced rates or partial exclusions for long-term capital gains, and some provide special treatment for gains from the sale of agricultural or family-owned property.
Understanding your state's specific rules is essential for accurate tax planning. For a comprehensive breakdown of capital gains tax rates in all 50 states, including special provisions for real estate, visit our state capital gains tax rates guide.
Related Tax Calculators & Guides
General Calculator
Capital gains tax calculator for all asset types including stocks, crypto, and investments.
View Calculator1031 Exchange Guide
Learn how to defer capital gains tax using a 1031 like-kind exchange for real estate.
Learn MoreHome Sale Tax Guide
Understand the $250K/$500K primary residence exclusion and home sale tax rules.
Learn MoreFrequently Asked Questions About Real Estate Capital Gains Tax
Explore more capital gains tax calculators and guides: