Capital Gains Tax Calculator: How to Figure the Tax on a Sale of Property
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:
- 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.
- Unrecaptured Section 1250 gain. On buildings, straight-line depreciation taken comes back at a maximum 25% rate (IRC 1(h)(1)(E), 2026).
- 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 run | Rental house, Arizona | Business asset sale, Texas | Primary home over the exclusion, California | Mistake: rental without depreciation |
|---|---|---|---|---|
| Filing status | Married, joint | Married, joint | Married, joint | Married, joint |
| State | Arizona | Texas | California | Arizona |
| 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 gain | 26.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
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.
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.
Frequently asked questions
How do I calculate capital gains on the sale of property?
How do I calculate capital gains on the sale of a rental property?
Does paying off my mortgage reduce capital gains tax?
How much capital gains tax do I pay on a $500,000 gain?
What is the capital gains tax on the sale of a primary residence?
Are selling costs deductible from capital gains?
Sources
- IRC 1001: amount realized and gain (Cornell LII)
- IRC 1016: adjustments to basis (Cornell LII)
- IRC 1: tax rates incl. 1(h) capital gain rates (Cornell LII)
- IRC 121: home sale exclusion (Cornell LII)
- IRC 1411: net investment income tax (Cornell LII)
- IRS Publication 544: Sales and Other Dispositions of Assets
- IRS Publication 523: Selling Your Home
- Rev. Proc. 2025-32: 2026 inflation adjustments (IRS)
- Instructions for Form 4797 (IRS)
- California FTB: capital gains and losses
Figures as of October 7, 2026; each rate and limit above names its source and year. Education only, not legal or tax advice.
Keep reading
Adjusted basis
How to build adjusted basis from your records, what goes in and what never does, inherited versus gifted basis, partnership and S corporation basis, and what a
ReadSection 1231 gain
Why business real estate, equipment and goodwill end up at long-term rates, how netting and the five-year lookback work, and where recapture cuts in first.
ReadRental property
How a rental sale is really taxed: the 25% depreciation layer, the losses the sale finally frees, the 3.8% tax, and why moving in first rarely helps.
ReadHome sale over the exclusion
For long-time owners whose gain beats $250,000 or $500,000: what is excluded, what is taxed, and the rules that move the line.
ReadDepreciation recapture
The part of your gain that came from depreciation is taxed differently; here is which rate applies, how much, and what defers it.
ReadPurchase price allocation
How the Section 1060 split between goodwill, equipment and non-competes sets the tax on a business sale.
ReadKnow 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.