How capital gains tax on real estate is calculated
Capital gains tax on real estate is calculated on your gain, which is the sale price minus selling costs minus your adjusted basis. This capital gains tax calculator for real estate then taxes that gain in layers: the part that comes from depreciation at up to 25%, the rest at long-term capital gains rates, plus any net investment income tax and state tax.
Your adjusted basis starts with what you paid, including closing costs, goes up with capital improvements, and goes down with every dollar of depreciation you took or were entitled to take. A building bought for $1.8 million ten years ago can easily have an adjusted basis well under $1.5 million today, which is why the gain is often larger than owners expect.
If you held the property for more than one year, the gain is long-term. If you held it for one year or less, the gain is short-term and taxed at ordinary income rates, which run up to 37% in 2026.
2026 federal long-term capital gains tax brackets
For 2026, long-term capital gains are taxed at 0%, 15% or 20% depending on your taxable income, under the thresholds the IRS set in Revenue Procedure 2025-32. The rate is based on where the gain falls once it is stacked on top of your other taxable income.
A large building sale usually pushes most of the gain into the 20% bracket. A married couple filing jointly reaches 20% once taxable income passes $613,700, and a single filer passes it at $545,500. The One Big Beautiful Bill Act, signed in July 2025, made the current ordinary income brackets permanent but did not change the 0%, 15% and 20% capital gains rates.
| Filing status (2026) | 0% rate up to | 15% rate up to | 20% rate above |
|---|---|---|---|
| Married filing jointly | $98,900 | $613,700 | $613,700 |
| Head of household | $66,200 | $579,600 | $579,600 |
| Single | $49,450 | $545,500 | $545,500 |
| Married filing separately | $49,450 | $306,850 | $306,850 |
| Estates and trusts | $3,300 | $16,250 | $16,250 |
Short-term capital gains tax on real estate
Short-term capital gains tax applies when you sell real estate you held for one year or less, and the gain is taxed at your ordinary income rate of 10% to 37% instead of the 0%, 15% or 20% long-term rates. IRS Tax Topic 409 draws the line at more than one year: hold a property one day past its first anniversary and the gain becomes long-term.
There is no separate short-term capital gains rate. The gain is added to your wages, business income and other ordinary income, then taxed through the 2026 brackets the IRS published in Revenue Procedure 2025-32. The 3.8% NIIT can still apply on top if your income is over the threshold.
Here is what the difference costs. A single filer with $90,000 of other taxable income sells a rental after 10 months for an $80,000 gain. The first $15,700 of that gain fills the 22% bracket up to $105,700 ($3,454), and the other $64,300 falls in the 24% bracket ($15,432), so the short-term tax is $18,886. Had the same owner waited past the one-year mark, the whole $80,000 would have been taxed at 15%, or $12,000. Two more months of ownership would have saved $6,886.
| 2026 ordinary rate | Single, taxable income over | Married filing jointly, taxable income over |
|---|---|---|
| 10% | $0 | $0 |
| 12% | $12,400 | $24,800 |
| 22% | $50,400 | $100,800 |
| 24% | $105,700 | $211,400 |
| 32% | $201,775 | $403,550 |
| 35% | $256,225 | $512,450 |
| 37% | $640,600 | $768,700 |
Unrecaptured Section 1250 gain: the 25% layer
The part of your gain equal to the straight-line depreciation you took on the building is called unrecaptured Section 1250 gain, and it is taxed at a maximum federal rate of 25%. IRS Tax Topic 409 states the rule directly.
If your ordinary income rate is below 25%, that portion is taxed at your lower ordinary rate instead. For most sellers of apartment buildings, other income plus the gain lands well above the 24% bracket, so the 25% cap applies to the whole amount. Gain on items depreciated over 5, 7 or 15 years after a cost segregation study is different: it is Section 1245 recapture, taxed as ordinary income with no 25% cap.
The 3.8% net investment income tax
The 3.8% net investment income tax (NIIT) applies to gain from selling investment real estate when your modified adjusted gross income is above $250,000 for married couples filing jointly, $200,000 for single and head of household filers, or $125,000 for married filing separately.
The tax is 3.8% of the smaller of your net investment income or the amount your MAGI exceeds the threshold. The IRS notes these thresholds are not indexed for inflation, so they are the same in 2026 as when the tax began in 2013. Owners who qualify as real estate professionals and materially participate may be able to treat rental activity as a non-passive business, which can take it outside the NIIT. That test is strict and worth reviewing with a CPA.
| Filing status | NIIT applies above MAGI of |
|---|---|
| Married filing jointly or qualifying surviving spouse | $250,000 |
| Single or head of household | $200,000 |
| Married filing separately | $125,000 |
State capital gains tax on real estate
Most states tax capital gains as ordinary income at the state’s regular rates, and a handful of states have no income tax at all. Enter your state rate in the calculator and it applies that rate to the full gain.
Texas is one of the states with no tax to add. Article VIII, Section 24-a of the Texas Constitution bars a tax on the net incomes of individuals, so a Texas owner selling a Texas building enters 0% for state tax and pays only the federal layers. Washington is a different case. It has a 7% capital gains tax, rising to 9.9% on taxable Washington capital gains above $1 million starting with tax year 2025, but the Washington Department of Revenue lists real estate as exempt.
Selling a building in another state can also trigger withholding at closing. California, for example, generally requires withholding of 3 1/3% of the sale price on many real estate sales unless an exemption applies, or the seller can elect an alternative calculation based on the gain (12.3% for individuals on Form 593). Check the rules in the state where the property sits, not just where you live.
California capital gains tax on real estate
California taxes capital gains on real estate as ordinary income, at the same rates as wages, with no lower rate for long-term gains. The Franchise Tax Board says it plainly: “California does not have a lower rate for capital gains.”
Large sales in California get taxed at the top of the scale. The 2025 California rate schedules top out at 12.3% on taxable income over $742,953 for single filers and $1,485,906 for married couples filing jointly. On top of that, the Behavioral Health Services Tax (formerly the Mental Health Services Tax) adds 1% on taxable income above $1,000,000, reported on line 62 of Form 540. A building sale that pushes taxable income past $1 million therefore pays up to 13.3% to California on the top slice.
Run the example later on this page through California instead of a 5% state. A $1,410,000 gain stacked on $450,000 of other income lands the couple in California’s top brackets, and about $860,000 of their taxable income sits above the $1 million line where the extra 1% applies. Enter a blended state rate close to your top bracket in the calculator to get a rough figure, and have your CPA run the actual California return.
How to use the calculator
Enter what you paid, what you spent on improvements, the depreciation you have taken, your expected sale price and selling costs, then pick your federal capital gains rate and state rate. Each result builds on the one before it.
- Adjusted basis = original purchase price + capital improvements − depreciation taken.
- Total gain = sale price − selling costs − adjusted basis.
- Depreciation recapture = the smaller of depreciation taken or total gain, taxed at up to 25% federally.
- Remaining capital gain = total gain − depreciation recapture, taxed at the federal rate you select (0%, 15% or 20%).
- NIIT, if switched on, adds 3.8% of the total gain. State tax applies your state rate to the total gain.
- Net proceeds before debt payoff = sale price − selling costs − estimated federal and state tax.
Worked example: selling a $3 million, 20-unit building
A married couple bought a 20-unit building in 2016 for $1,800,000, with $360,000 of that allocated to land. In 2021 they spent $200,000 on new roofs and boilers. Their depreciation schedule shows $560,000 taken to date. They have about $450,000 of other taxable income and sell the building in 2026 for $3,000,000, paying $150,000 in commissions and closing costs.
Adjusted basis is $1,800,000 + $200,000 − $560,000 = $1,440,000. The amount realized is $3,000,000 − $150,000 = $2,850,000, so the total gain is $1,410,000.
The first $560,000 of gain is unrecaptured Section 1250 gain. Because their other income already sits in the 32% bracket, the 25% cap applies: $140,000. The remaining $850,000 stacks above $613,700 of taxable income, so all of it is taxed at 20%: $170,000. Their MAGI is far above $250,000, so the NIIT applies to the full $1,410,000 gain: $53,580. Federal tax comes to $363,580.
Add a 5% state income tax on the gain ($70,500) and the total tax is about $434,080, roughly 31% of the gain. Before paying off any mortgage, they would net about $2,415,920.
| Line | Amount |
|---|---|
| Sale price | $3,000,000 |
| Selling costs | −$150,000 |
| Adjusted basis ($1.8M + $200K − $560K) | $1,440,000 |
| Total gain | $1,410,000 |
| Unrecaptured 1250 gain × 25% | $140,000 |
| Remaining gain $850,000 × 20% | $170,000 |
| NIIT 3.8% × $1,410,000 | $53,580 |
| State tax 5% × $1,410,000 (example rate) | $70,500 |
| Total estimated tax | $434,080 |
| Net proceeds before mortgage payoff | $2,415,920 |
Deferring capital gains tax on real estate with a 1031 exchange
A 1031 exchange would defer the full $434,080 in the example above, as long as the couple reinvests all $2,850,000 of net proceeds into like-kind real estate of equal or greater value and replaces the debt they paid off.
Say they buy a $3,200,000 building. The deferred gain carries into the new property, so its basis is about $3,200,000 − $1,410,000 = $1,790,000 rather than its full price. The tax is postponed, not erased. If they later sell without another exchange, the deferred gain and recapture come due then. If they hold until death, heirs generally receive a stepped-up basis.
The deadlines are fixed by law: you identify replacement property within 45 days of the sale and close within 180 days, with a qualified intermediary holding the money in between. Cash you take out of the exchange, called boot, is taxable.
The 180-day window ends early if your tax return for the year of sale comes due first, so a seller closing late in the year may need to file an extension. The IRS says neither deadline can be extended for hardship, except in presidentially declared disasters. Your written list of replacement properties must go to the intermediary or another party to the exchange, not just to your own agent.
Rental property capital gains calculator: what is different from a home sale
A rental property capital gains calculator has to handle two things a home sale usually doesn’t: depreciation recapture and the lack of the home sale exclusion. The Section 121 exclusion of up to $250,000 of gain ($500,000 for married couples) applies only to a main home you owned and lived in for two of the past five years.
Rental property gets no exclusion, and every year of depreciation lowers your basis. That makes the gain on a rental bigger and the tax more layered, which is why this calculator asks for depreciation taken as a separate input.
Capital gains tax on commercial real estate
Capital gains tax on commercial property follows the same federal rules as an apartment building: 0%, 15% or 20% on long-term gain, up to 25% on unrecaptured Section 1250 gain, and the 3.8% NIIT when your income is over the threshold. What changes is how fast the depreciation piles up.
Under Section 168(c) of the tax code, nonresidential real property such as an office, retail or industrial building is depreciated over 39 years, against 27.5 years for residential rental property. Both use the mid-month convention. A building counts as residential rental property only if at least 80% of its gross rental income comes from dwelling units, so a mixed-use building with large ground-floor retail rents can end up on the 39-year schedule.
The slower schedule means less recapture for the same building cost. On $1,000,000 of building basis, ten years of 39-year depreciation is about $256,410, which at the 25% cap is about $64,100 of recapture tax. The same basis on an apartment building would have produced about $363,636 of depreciation and $90,909 of recapture tax. Cost segregation on a commercial building works the same way it does on apartments: the reclassified 5-, 7- and 15-year items are Section 1245 property, taxed at ordinary rates when you sell.
Apartment buildings with five or more units are financed and marketed as commercial real estate, but for depreciation they are still residential rental property, so this calculator handles them as entered.
Depreciation recapture tax calculator
If you don’t know how much depreciation you have taken, use our depreciation recapture calculator first. It estimates the figure from your purchase price, land share, improvements and years owned, using the 27.5-year recovery period for residential rental property.
Then bring that number back here. The IRS generally computes recapture on depreciation that was allowed or allowable, so entering zero because you never claimed it will understate your tax.
Other ways to defer or spread the tax
An installment sale, such as a seller-financed deal, spreads recognition of the gain over the years you receive principal payments. Under IRS rules, the unrecaptured Section 1250 gain is generally taxed first as payments come in, so the early payments carry the 25% layer.
Selling in a year when your other income is lower can also help, since more of the gain may fall in the 15% bracket and the recapture layer may be taxed below 25%. Some owners time a sale for the year after they retire or after a business sale has already been taxed.
Holding the building until death is the other path. Heirs generally receive a basis stepped up to market value, which can remove both the capital gain and the past depreciation from the tax bill. That trades a tax saving for keeping the building, its management and its risks for the rest of your life.
We buy directly, close on your timeline, and can work inside 1031 deadlines, including a delayed closing to match your exchange.
Common mistakes
These errors are the usual reasons an estimate misses by a wide margin.
- Leaving out depreciation because you never claimed it.
- Counting repairs as capital improvements. Only work that added value or extended the building’s life belongs in basis.
- Forgetting acquisition closing costs, which usually add to your original basis.
- Treating net proceeds as cash in hand. Your mortgage payoff still comes out of the figure shown.
- Using the wrong state rate, or forgetting that the state where the building sits may tax the sale.
Selling? Spread the tax with seller-carry terms
If a large tax bill is what is keeping you from selling, an installment sale may help. When you carry part of the price as a note, the gain is generally reported as you receive payments instead of all in the year of sale. Some parts of the gain, such as certain depreciation recapture, can still be due up front, so run the numbers with your CPA first.
Skyline Capital Investments buys apartment buildings with five or more units and can offer seller-carry terms, or a delayed closing that fits your 1031 timeline. Send the address and unit count and we typically respond within 48 hours. How seller financing works · How an installment sale is taxed · Seller financing calculator.
Get A Seller-Carry Offer