Step 1: Compute adjusted basis
Start with your adjusted basis: purchase price, plus capital improvements, minus total depreciation claimed (or allowable). Example: buy for $280,000, add $20,000 in improvements, claim $60,000 in depreciation → adjusted basis = $240,000.
Step 2: Split the gain into two buckets
Compute total gain: net sale price minus adjusted basis. Allocate to (a) depreciation recapture — the portion equal to depreciation claimed, taxed at up to 25%; and (b) long-term capital gain above that, taxed at 0%, 15%, or 20%. Example: sell for $450,000 → total gain $210,000. Recapture: $60,000 at 25% = $15,000. Capital gain: $150,000 at 15% = $22,500. Federal total: $37,500.
Step 3: Add NIIT and state tax
High-income sellers may also owe the 3.8% Net Investment Income Tax on top of federal rates. State income taxes apply in most states — with no 25% federal cap equivalent. Your total tax can be significantly higher than the federal-only estimate. Use the capital gains calculator below for a more complete projection.
Building adjusted basis, line by line
Adjusted basis is where most calculation errors hide, so build it deliberately. Start with your original cost (purchase price). Add: capitalized closing costs at purchase (title, recording, survey, transfer taxes, some legal fees), and every capital improvement — a new roof, HVAC, addition, kitchen remodel, or structural work (but not routine repairs, which you already deducted). Subtract: total depreciation claimed or allowable, plus any casualty-loss deductions or insurance reimbursements that reduced basis. The result is your adjusted basis. Missing a single improvement here inflates your taxable gain dollar for dollar.
What counts as a selling expense
Selling costs reduce your amount realized, which lowers the gain. Deductible-from-proceeds costs include real estate commissions, title and escrow fees, transfer and documentary stamp taxes, recording fees, and attorney fees tied to the sale. They do not include payoff of your mortgage (that's just returning borrowed money) or prorated property taxes and interest, which are handled elsewhere. On a $500,000 sale, 5–7% in selling costs can knock $25,000–$35,000 off the gain, so account for them precisely.
Where each number goes on your tax forms
The rental sale is reported on Form 4797, not directly on Schedule D. Section 1250 property flows through Part III of Form 4797; the depreciation portion is carried to the Unrecaptured Section 1250 Gain Worksheet in the Schedule D instructions (max 25%), and the net long-term gain moves to Schedule D and then Form 1040. If you sold on installments, Form 6252 feeds Form 4797. Knowing the form path helps you sanity-check tax software, which sometimes mishandles the split between the two lanes.
Holding period: the one-year line
To get the preferential 0/15/20% long-term rates on the capital-gain portion, you must have held the property more than one year. Sell at 12 months or less and that portion is short-term — taxed at your full ordinary income rate. Your holding period generally starts the day after you acquire the property and ends on the sale date. For most buy-and-hold investors this is a non-issue, but flippers and quick-turn owners can lose a large chunk of the benefit by selling a few weeks early.
A complete worked example
Buy a rental for $280,000; capitalize $6,000 of purchase closing costs; add $20,000 of improvements; claim $60,000 of depreciation over the hold. Adjusted basis = $280,000 + $6,000 + $20,000 − $60,000 = $246,000. Sell for $450,000 with $30,000 of selling costs → amount realized $420,000. Total gain = $420,000 − $246,000 = $174,000. Split it: $60,000 unrecaptured Section 1250 gain (25% = $15,000) and $114,000 long-term capital gain (15% = $17,100). Federal ≈ $32,100. Add 3.8% NIIT if you're over the MAGI threshold (≈ $6,612 more) and your state's rate, and the true bill climbs from there.
Reducing the bill
Several levers can shrink or defer this tax. A 1031 exchange defers the entire gain — recapture and capital gain alike — into a replacement property. An installment sale spreads the capital-gain portion across the years you collect payments, potentially keeping you in lower brackets. Converting the rental back to a primary residence can qualify part of the gain for the Section 121 exclusion ($250,000 single / $500,000 married) — but the exclusion is prorated for periods of 'nonqualified use' as a rental and never covers depreciation recapture. Finally, holding until death gives heirs a stepped-up basis, eliminating the built-in gain entirely.
Why the order of the two lanes matters
It is tempting to lump everything into 'capital gains,' but the recapture lane is computed first and is fixed at the amount of depreciation taken (limited to total gain). Only what remains after carving out recapture gets the preferential 0/15/20% treatment. This ordering is why two owners with identical sale prices can owe very different tax: the one who depreciated aggressively (say, via cost segregation) has a larger recapture bucket taxed at up to 25% or ordinary rates, and a smaller capital-gain bucket. When you model a sale, always separate the two buckets before applying any rate.
Suspended passive losses can offset the gain
Many rental owners have suspended passive losses — deductions the passive activity rules blocked in prior years and carried forward. A key benefit: when you sell the entire interest in the property in a fully taxable transaction, those suspended losses are generally released and can offset not only the gain on that property but other income as well. This can meaningfully reduce, or even wipe out, the taxable gain. Before assuming your calculated gain is the final number, check Form 8582 for accumulated suspended losses that free up at disposition.
Short-term vs. long-term makes a big difference
If you held the property one year or less, the capital-gain lane is short-term and taxed at your ordinary rate — potentially 37% federally — instead of 0/15/20%. The recapture lane is unaffected (it is already tied to ordinary rates capped at 25% for real property), but losing preferential treatment on the appreciation portion can add tens of thousands to the bill on a large gain. For anyone selling near the one-year mark, confirming the holding period before signing can be the most valuable single move in the whole transaction.
Sanity-check with a calculator, then a pro
The arithmetic is straightforward but easy to get wrong at the edges — allocating land, catching every improvement, applying NIIT thresholds, coordinating state tax, and releasing suspended losses. Use the capital gains calculator below to get a reliable first estimate, then confirm anything material with a tax professional before you list, especially if a 1031 exchange or installment sale is on the table. A modest planning fee often saves multiples of itself on a six-figure gain.
Allocating land vs. building at purchase
Because land is never depreciable, the split between land and building at purchase shapes both your annual depreciation and your basis math at sale. A reasonable allocation typically follows the county assessor's ratio of land-to-improvement value, a professional appraisal, or another supportable method — you cannot simply assign everything to the building to maximize depreciation. Getting this allocation right (and documenting it) at purchase prevents disputes years later when you compute gain, because the depreciation you took (which reduces basis and creates recapture) all flows from that original split.
Improvements vs. repairs — a costly distinction
Only capital improvements add to basis; repairs were already deducted as expenses in the year you paid them and do not increase basis. A new roof, an addition, or a full kitchen remodel is an improvement; patching, repainting, and fixing a leak are repairs. Owners who conflate the two either overstate basis (understating gain, an audit risk) or lose legitimate basis by never tracking improvements. Keep a running 'basis schedule' from day one listing every capital improvement with its date and cost, so your adjusted basis at sale is both accurate and defensible.
Selling in an installment: a quick illustration
Say your capital-gain portion is $150,000 and you finance the buyer over five years. Under an installment sale (Form 6252), you recognize a proportional slice of that gain as each principal payment arrives — roughly $30,000 a year here — which can keep you out of the 20% bracket and under the NIIT threshold in any single year. The trade-offs: interest income is taxable, you carry buyer-default risk, and the depreciation-recapture portion is generally taxed up front rather than spread. Still, for a seller comfortable acting as the bank, installment treatment is one of the few tools that smooths the capital-gain lane across years.
Frequently asked questions
What is the step-by-step formula for capital gains on a rental?
(1) Compute adjusted basis. (2) Compute total gain. (3) Allocate to recapture (up to 25%) then capital gains (0/15/20%). (4) Add NIIT if applicable and state tax.
Does depreciation increase capital gains tax?
Yes — depreciation reduces your basis, which increases total gain. It also creates a recapture component taxed separately at up to 25%.
What closing costs can I add to basis or deduct from the sale?
At purchase, capitalize costs like title, recording, survey, and transfer taxes into basis. At sale, subtract commissions, title/escrow, transfer taxes, and sale-related legal fees from the proceeds. Mortgage payoff is not a selling expense.
Can I use the primary-residence exclusion on a former rental?
Sometimes. If you convert it to your main home and meet the two-of-five-year ownership and use tests, part of the gain may qualify for the Section 121 exclusion — but it is prorated for rental (nonqualified) use and never shelters depreciation recapture.
Do I report a rental sale on Schedule D or Form 4797?
Both. The sale is reported on Form 4797; the depreciation portion runs through the Unrecaptured Section 1250 Gain Worksheet and the net long-term gain flows to Schedule D and Form 1040.
Do suspended passive losses reduce my gain?
Often, yes. When you sell your entire interest in a rental in a fully taxable transaction, previously suspended passive losses are generally released and can offset the gain and other income. Check Form 8582 for carried-forward losses before assuming your calculated gain is final.
Does the one-year holding period change the tax?
Yes for the capital-gain portion: property held one year or less produces short-term gain taxed at ordinary rates, while more than a year qualifies for the preferential 0/15/20% long-term rates. The recapture portion is unaffected.
Sources
- IRS Topic No. 409 — Capital Gains and Losses
- IRS Publication 544 — Sales and Other Dispositions of Assets
- IRS Publication 946 — How to Depreciate Property
Educational information and estimates only. Not tax advice. Tax rules change and vary by situation; consult a qualified tax professional before acting.
