
Capital Gains Tax on Rental Property: Calculator and Worked Example
The tax on selling a rental property surprises people twice: once because the bill is bigger than the "capital gains rate" they had in mind, and again because most of the surprise comes from a layer they forgot they were accruing — the depreciation they deducted (or could have) every year of ownership, which comes back at sale under its own, higher rate. The free calculator on this page estimates the whole bill, layer by layer; this guide walks the anatomy on one worked example, then covers what legitimately reduces the number and how a 1031 exchange changes it.
The standing caution first: this is federal-framework estimation for a calculation that ultimately depends on your full return, your state, and your facts. Every figure is an illustrative example, and the sale-year projection belongs in front of a CPA before the listing agreement — several of the planning levers below only work before the sale.
The Anatomy: Five Steps to the Gain
The worked example (deliberately the same property as our 1031 exchange calculator, so the two articles price the two paths on identical facts): a rental purchased for $450,000 — of which $90,000 was land — held eight years, selling for $750,000 with $45,000 of selling costs and a $280,000 loan balance.
Step 1 — Cost basis. The purchase price plus acquisition costs plus capital improvements over the hold (the new roof capitalizes; the repainting was an expense). Our example: $450,000, improvements omitted for clarity — but in real files this is where good records earn real money, since every documented improvement dollar reduces the gain dollar-for-dollar.
Step 2 — Accumulated depreciation. The building (never the land) depreciates over the residential 27.5-year schedule: $360,000 ÷ 27.5 × 8 years ≈ $104,700. Two rules with teeth here: land is excluded (which is why the purchase-price allocation years ago matters at sale), and — the trap — the "allowed or allowable" rule: this reduction applies whether or not you actually claimed the deductions. Skipping depreciation saves nothing at sale; it only forfeits the annual deductions. (An owner who under-claimed should ask their CPA about the catch-up mechanisms before selling.)
Step 3 — Adjusted basis. $450,000 − $104,700 ≈ $345,300.
Step 4 — Amount realized. Sale price minus selling costs: $750,000 − $45,000 = $705,000. Note the loan payoff appears nowhere in this step — debt affects your cash, not your gain, a distinction with consequences below.
Step 5 — Total gain. $705,000 − $345,300 ≈ $359,700.
The Two Layers (Plus One Surcharge)
The gain now splits, and the split is where the "15% capital gains" expectation breaks:
Layer 1 — Unrecaptured §1250 gain: the gain attributable to depreciation — the $104,700 — taxed at a maximum 25% federal rate: up to ~$26,200. This is the accrued bill of every depreciation year, presenting itself at once.
Layer 2 — Long-term capital gain: the remaining $255,000, at the 0/15/20% brackets — illustratively at 15%: ~$38,300.
The surcharge — NIIT: the 3.8% net investment income tax applies above the MAGI thresholds ($200,000 single / $250,000 married filing jointly), and a large sale year often pushes a taxpayer over them: potentially ~$13,700 here.
Illustrative federal total: roughly $78,000 — about 21.7% of the gain, blended — plus state tax, which ranges from zero to double digits and belongs in any real estimate. And the cash-versus-gain distinction now bites: after the $280,000 payoff, the sale nets $425,000 of pre-tax cash, so the tax consumes nearly a fifth of the check — and a highly-leveraged or heavily-refinanced property can genuinely owe tax approaching or exceeding its cash proceeds, because the gain is computed on basis while the cash is computed after debt. Sellers who refinanced their equity out over the years meet this arithmetic at the worst possible moment.
What Legitimately Reduces the Bill
The levers, roughly in order of how often they're missed:
- Complete basis records. Every capitalized improvement, acquisition cost, and (for exchanged-into properties) the correct carryover basis — the cheapest tax planning is documentation.
- Suspended passive losses. Years of rental losses limited by the passive-activity rules generally release in full at a complete taxable disposition — for long-time owners this can offset a startling share of the gain, and it is the single best reason the sale-year projection needs a CPA who has your carryforward history.
- Timing and brackets. The LTCG layer runs through the 0/15/20% brackets and NIIT has thresholds — a sale landing in a low-income year (retirement's first years, a business-loss year) can price dramatically better than the identical sale a year earlier.
- Installment sales. Seller financing can spread the capital-gain layer across the payment years (the depreciation layer generally cannot wait) — a structure with real tradeoffs your CPA can model.
- The primary-residence overlap. The §121 exclusion belongs to homes, not rentals — but converted properties (home-turned-rental, rental-turned-home) can qualify for partial exclusion under rules with holding-period and "nonqualified use" limits that are firmly CPA territory. If your rental was ever your residence, raise it.
- Basis step-up at death. Under current law, heirs generally receive basis stepped up to date-of-death value — extinguishing the accrued gain entirely. Grim, but it is the endpoint that makes indefinite deferral a coherent strategy.
- And the deferral itself — the 1031 exchange, next.
The 1031 Comparison, on the Same Numbers
Run the identical sale through a compliant exchange and the entire ~$78,000 federal bill (and generally the state bill, subject to state conformity) defers — staying invested in the replacement property, at the price of a carryover basis and the deadlines and boot rules that govern exchanges. The full exchange-side math — including the trade-up tests, the $55,000-boot version of this same example, and the carryover basis that keeps the deferred gain alive — is the 1031 exchange calculator guide; the decision between the two paths, and behind it whether to sell at all, is the hold-versus-sell framework. The three articles are one analysis: this page prices the sale, the exchange page prices the deferral, and the framework weighs them against simply keeping the property.
Frequently Asked Questions
How much tax will I pay when I sell my rental property? Two federal layers plus possibly a surcharge: the depreciation-attributable gain at up to 25%, the remaining long-term gain at 0/15/20%, and NIIT at 3.8% above the MAGI thresholds — plus state tax. The worked example lands near 22% of the gain, blended, federally; your facts will differ, which is what the calculator and your CPA are for.
What is depreciation recapture on a rental? The portion of your gain attributable to depreciation taken (or allowable) during ownership — for real property, taxed as unrecaptured §1250 gain at a maximum 25% rate. It accrues silently every year and presents at sale, whether or not you claimed the deductions.
Do I pay capital gains tax if I sell at a loss? A genuine loss on an investment property (amount realized below adjusted basis) is generally deductible under its own rules — but note that depreciation lowers the basis, so a property that "sold for less than I paid" can still show a taxable gain. The five-step anatomy above, not the purchase price, decides.
Does paying off the mortgage reduce my taxable gain? No — debt affects cash, not gain. This is precisely why heavily-refinanced properties can owe tax out of proportion to their sale check, and why the calculator reports both numbers.
What if I never claimed depreciation on my rental? The "allowed or allowable" rule means the recapture layer applies anyway — your basis is reduced by the depreciation you could have taken, whether or not you took it. The good news is that catch-up mechanisms exist for recovering missed deductions (an accounting-method change your CPA can file), and pursuing that before the sale year is one of the most valuable corrections in rental tax practice. Raise it the moment you notice the gap.
How long do I have to own a rental for long-term rates? More than one year for the long-term brackets; shorter holds price the gain layer at ordinary rates. The depreciation layer's treatment doesn't improve with brevity either — confirm the specifics for short holds with your CPA.
Price Both Paths Before You List
The free calculator on this page runs the layered estimate — basis, depreciation, both gain layers, NIIT, and the net-of-payoff cash view. The After-Tax / 1031 Suite runs the decision: sell-and-pay versus exchange, side by side on your numbers, with after-tax proceeds under each path and the replacement hold modeled through the carryover basis — fully unlocked, formula-transparent, versioned, with a documented methodology PDF. For the guided web version, the YieldSheets platform is in development — join the waitlist.
This article is for educational purposes only and does not constitute tax, legal, or investment advice. All figures are illustrative examples. Tax rates, thresholds, and rules are subject to change and depend on your specific facts and state — verify current rules with the IRS and engage a CPA before any sale or exchange.
Get the next breakdown in your inbox
New CRE modeling walkthroughs 3× per week. No spam, unsubscribe anytime.

