Big Sale TaxHans Goldstein: Tax & Exit Planning
Home / Capital Gains / Capital gains tax calculator
Capital gains tax calculator

Capital Gains Tax Calculator: How to Figure the Tax on a Sale of Property

Short answerPrice minus selling costs minus adjusted basis is your gain. Split that gain into Section 1245 recapture (ordinary rates), unrecaptured Section 1250 gain (25% cap, IRC 1(h)) and the rest at 0/15/20% (Rev. Proc. 2025-32, 2026), then add the 3.8% NIIT and your state. Our Arizona rental example: $964,000 of gain, $250,680 of tax.

The four-line method every capital gains calculator uses

Strip away the interface and every capital gains calculator on a sale of property runs the same four lines. First, the amount realized: the contract price plus any debt the buyer takes over, minus commissions, title and escrow fees, transfer taxes and legal fees you paid to sell (IRC 1001(b); IRS Publication 544). Second, subtract your adjusted basis: what you paid, plus acquisition costs and improvements, minus depreciation (IRC 1016). The result is the gain under IRC 1001(a).

Third, sort the gain by character, because one sale can carry three different federal rates. Fourth, stack it on top of your other income for the year, apply the federal brackets, the net investment income tax and your state. The calculator on this page does all four; it is only as right as the basis and split you give it. Our adjusted basis guide covers the second line in depth.

Splitting the gain: the step most calculators hide

A single number labeled capital gain is where most free calculators go wrong on business and rental property. The gain from a sale of depreciated property breaks into layers, and they are taxed in this order:

  1. Section 1245 recapture. Gain on equipment, vehicles, furniture and other personal property, up to the depreciation you took, is ordinary income taxed at rates up to 37% (IRC 1245; Rev. Proc. 2025-32 brackets for 2026). It is reported on Form 4797 Part III.
  2. Unrecaptured Section 1250 gain. On buildings, straight-line depreciation taken comes back at a maximum 25% rate (IRC 1(h)(1)(E), 2026).
  3. Long-term capital gain or Section 1231 gain. Everything above original cost on property held more than one year gets 0%, 15% or 20%. See our Section 1231 gain guide for how business property lands here.

In a business sale, the buyer and seller set these layers through the purchase price allocation on Form 8594, which is why the purchase price allocation analysis matters as much as the price. On real estate, the land and building split drives the depreciation that later becomes the 25% layer; our depreciation recapture analysis walks through it.

Worked example 1: a rental house in Arizona

A couple bought a rental in 2014 for $700,000, added $60,000 of improvements and claimed $220,000 of depreciation. Adjusted basis: $540,000. They sell for $1,600,000 and pay $96,000 in commissions and closing costs, so the amount realized is $1,504,000 and the gain is $964,000. Of that, $220,000 is unrecaptured 1250 gain and $744,000 is long-term gain.

With $180,000 of other income, the engine shows $198,633 of federal income tax, $33,972 of net investment income tax and $18,075 to Arizona, a total of $250,680 or 26.0% of the gain. Arizona's flat 2.5% rate for 2026 is paired with a subtraction of 25% of net long-term gain on assets acquired after December 31, 2011 (A.R.S. 43-1022(22)), which the engine applies. Rental gain counts as net investment income under IRC 1411, so the 3.8% layer applies above $250,000 of modified AGI for joint filers (not indexed). More on rentals in capital gains tax on rental property.

Worked example 2: selling business assets in Texas

An owner-operator sells the assets of a company for a price that produces $350,000 of equipment gain (all depreciation taken, so all 1245 recapture) and $2,000,000 of goodwill and other long-term gain. Texas has no personal income tax, so the bill is federal only: $517,975, with $517,975 of regular federal tax. Because the seller materially participated, gain on business assets is outside the 3.8% NIIT base under IRC 1411(c), a distinction many generic calculators miss.

The recapture slice is the expensive part per dollar: it sits on top of the couple's other income and fills the 32%, 35% and 37% brackets (Rev. Proc. 2025-32, 2026) before any long-term gain is taxed. Shifting allocation from equipment to goodwill, where the facts support it, changes the result more than any rate assumption. Our guide to tax on the sale of a business covers the deal side.

Worked example 3: a home that outgrew the exclusion

Married owners bought their California home for $900,000 and sell it for $2,400,000 with $130,000 of selling costs. Gain: $1,370,000. Section 121 excludes up to $500,000 for joint filers who owned and lived in the home two of the last five years (IRC 121(b), 2026), leaving $870,000 taxable. The engine puts the tax at $264,468, including $85,123 to California, which taxes capital gains as ordinary income at rates up to 13.3% with the 1% surcharge over $1 million (FTB, 2026).

Two calculator traps apply to homes. Any depreciation taken after May 6, 1997 for a home office or rental use cannot be excluded (IRC 121(d)(6)). And periods of nonqualified use after 2008, such as renting the home before moving in, shrink the exclusion pro rata (IRC 121(b)(5)). Our home sale over the exclusion page goes deeper.

Common input mistakes and what they cost

  • Leaving out depreciation. Basis drops by depreciation allowed or allowable, even years you forgot to claim it (IRC 1016(a)(2)). Our fourth example re-runs the Arizona rental without the $220,000: the result understates the bill by $85,613, and the return would be wrong.
  • Subtracting the mortgage payoff. Paying off a loan at closing changes your cash, not your gain. Debt relief is part of the amount realized (Publication 544, 2026 revision).
  • Using purchase price as basis on inherited property. Heirs generally use fair market value at death (IRC 1014). See capital gains on inherited property.
  • Treating the whole gain as 15%. Above $613,700 of taxable income for joint filers the rate is 20% (Rev. Proc. 2025-32, 2026), and recapture is never at 15%.
  • Ignoring the state. Real estate gain is generally taxed by the state where the property sits, even if you live elsewhere.
  • Forgetting holding period. Property held one year or less produces short-term gain at ordinary rates (IRC 1222).

When a calculator is not enough

A one-year calculator is the right tool for a clean cash sale. It falls short when the answer depends on choices rather than arithmetic:

  • Payments over time. Under a Section 453 installment sale, gain is recognized as cash arrives, but recapture is taxed in the year of sale anyway (IRC 453(i)). That needs a multi-year model.
  • Exchanges and reinvestment. A 1031 exchange or an Opportunity Zone investment changes what is taxed this year.
  • Suspended losses and carryovers. Passive losses freed by a full disposition (IRC 469(g)) and capital loss carryovers can offset a large share of the gain. See loss carryovers.
  • Phase-outs and surcharges. A big gain year can push up Medicare premiums and phase out deductions; the NIIT on a sale analysis covers the 3.8% layer.
  • Moving. Changing residency before closing can matter for stock and business interests but rarely for real estate; see state residency change before a sale.

For a written side-by-side of every path on your actual numbers, get the Big Sale Tax Analysis.

What to know

A calculator is a model, and its output is only as good as the basis records and the allocation you feed it. Engine figures here use 2026 federal tables (Rev. Proc. 2025-32) and each state's modeled rule; they exclude local taxes, AMT credit carryovers, phase-outs of specific deductions and Medicare premium surcharges. A sale with seller financing, a business allocation in dispute or property in more than one state deserves a full return projection reviewed by your CPA before you sign.

Worked example

Bought 2014 for $700,000, $60,000 of improvements, $220,000 depreciation taken; sold for $1,600,000 with $96,000 of selling costs. Gain $964,000: $220,000 unrecaptured 1250, $744,000 long-term. Joint filers with $180,000 of other income. Owner-operator sells assets: $350,000 of equipment gain is 1245 recapture and $2,000,000 is goodwill and other long-term gain. Joint filers, $200,000 of other income, active in the business so NIIT does not reach the gain. Bought for $900,000, sold for $2,400,000 with $130,000 of costs: $1,370,000 gain less the $500,000 joint exclusion leaves $870,000 taxable. Joint filers with $160,000 of other income. Same Arizona rental as the first example, but the $220,000 of depreciation was left out of basis, so only $744,000 of gain is entered.

Engine runRental house, ArizonaBusiness asset sale, TexasPrimary home over the exclusion, CaliforniaMistake: rental without depreciation
Filing statusMarried, jointMarried, jointMarried, jointMarried, joint
StateArizonaTexasCaliforniaArizona
Other income (wages, pension, interest)$180,000$200,000$160,000$180,000
Long-term capital gain$744,000$2,000,000$870,000$744,000
Unrecaptured Section 1250 gain (25% max)$220,000$0$0$0
Section 1245 recapture (ordinary income)$0$350,000$0$0
Federal income tax on the sale$198,633$517,975$149,705$125,505
Net investment income tax (3.8%)$33,972$0$29,640$25,612
State income tax on the sale$18,075$0$85,123$13,950
Total tax caused by the sale$250,680$517,975$264,468$165,067
Effective rate on the gain26.0%22.0%30.4%22.2%
Gain kept after these taxes$713,320$1,832,025$605,532$578,933

Computed October 7, 2026 by the Big Sale Tax engine (engine.js yearTax): federal brackets, 0/15/20% thresholds and AMT from Rev. Proc. 2025-32 (OBBBA-adjusted) and the One Big Beautiful Bill Act (P.L. 119-21); NIIT under IRC 1411 (thresholds not indexed); state tax from the engine's state table (where a state has not yet published 2026 brackets, its 2025 table is used and labeled projected). "Tax caused by the sale" = tax with the sale minus tax without it. Excludes selling costs, local taxes and estimated-tax timing. Education only.

Run your own numbers

Federal on the sale$0
NIIT$0
State$0
Total tax, held over a year$0
Effective rate0%
If held one year or less$0

2026 law from the engine: federal 0/15/20% brackets (Rev. Proc. 2025-32), 25% cap on unrecaptured 1250 gain, ordinary rates on 1245 recapture, 3.8% NIIT over $200,000 single / $250,000 joint (IRC 1411), AMT, and your state's rules. Tax shown is the tax caused by the sale. Excludes selling costs, local taxes and NIIT exceptions for active business owners. Education only.

Free PDF sheet

Long-Term vs Short-Term Capital Gains (2026)

The one-year holding rule, the 2026 0/15/20% thresholds for every filing status, NIIT, recapture, the state layer and a worked $200,000 example: 11 months vs 13 months, and what spreading the gain can save.

By entering your email you agree to receive this sheet and occasional educational emails from Hans Goldstein: Tax & Exit Planning. Unsubscribe anytime.

Frequently asked questions

How do I calculate capital gains on the sale of property?
Start with the sale price, subtract selling costs to get the amount realized, then subtract your adjusted basis (purchase price plus acquisition costs and improvements, minus depreciation). The difference is your gain under IRC 1001. Split it into depreciation recapture and long-term gain, apply the 2026 federal rates from Rev. Proc. 2025-32, add the 3.8% NIIT if your modified AGI is above the threshold, then add state tax.
How do I calculate capital gains on the sale of a rental property?
Use the same method, but track depreciation. Every dollar of straight-line depreciation on the building comes back as unrecaptured Section 1250 gain taxed at up to 25% (IRC 1(h)(1)(E)), and any furniture or appliances produce Section 1245 recapture at ordinary rates. In our Arizona rental example the total tax is $250,680, of which $33,972 is the 3.8% net investment income tax.
Does paying off my mortgage reduce capital gains tax?
No. The loan payoff comes out of your sale proceeds, but it is not a selling expense and it does not raise your basis. Gain is computed on the full amount realized, including debt relieved, minus adjusted basis (IRS Publication 544). That is why a heavily refinanced property can produce a tax bill larger than the cash you walk away with.
How much capital gains tax do I pay on a $500,000 gain?
It depends on your other income, filing status, state and how much of the gain is recapture. For 2026, joint filers pay 0% on long-term gain up to $98,900 of taxable income, 15% up to $613,700 and 20% above that (Rev. Proc. 2025-32). A gain that size usually triggers the 3.8% NIIT too, unless it comes from an active business or a home exclusion.
What is the capital gains tax on the sale of a primary residence?
Gain up to $250,000 ($500,000 joint) is excluded if you owned and lived in the home two of the last five years (IRC 121). Gain above that is long-term gain taxed at 0/15/20% plus NIIT and state tax. In our California example, $870,000 above the exclusion produces $264,468 of tax.
Are selling costs deductible from capital gains?
Yes, in effect. Commissions, title and escrow fees, transfer taxes, legal fees and advertising reduce your amount realized, which lowers the gain dollar for dollar (IRS Publication 523 for homes, Publication 544 for other property). Repairs made just to sell are not added to basis, but improvements with a life longer than a year are.
How Hans helps: the $5,000 Big Sale Tax Analysis runs your sale through every path that fits: a cash sale, a Section 453 installment sale, 1031, Opportunity Zones, charitable trusts, timing and loss offsets, year by year, and ends with a written recommendation your CPA can check. Get the Big Sale Tax Analysis.
Next step

Know your number before you sign.

The Big Sale Tax Analysis is a flat $5,000. Start with a free scoping call; you are invoiced only after it, and only if you go ahead.

Prefer email? Request the analysis by email.

Book a callCall Hans