The hardest number to find when you sell a rental is not the price. It is the tax. A buyer offers you $470,000, your agent walks you through commissions, and somewhere in that conversation a quiet assumption forms that the gain is the price minus what you paid. It is not. The gain the IRS taxes is built on your adjusted basis, and that basis has been moving down every year you owned the property, which means the taxable gain is almost always larger than the napkin math suggests.
Most articles on this hand you a rate and stop. The actual sale of a 1-10 unit rental has four moving parts: your adjusted basis, the depreciation you have to recapture, the long-term gain on the appreciation, and a 3.8% surtax that catches higher-income sellers. This page walks all four on one sale, in real dollars, so you can see how they stack before you sign anything. It owns the sale event; the annual depreciation mechanics behind it live in the 27.5-year depreciation guide, and the wider return in the rental property taxes guide.
Start with adjusted basis, not purchase price
Your gain is the net sale price minus your adjusted basis, so basis is where the whole calculation begins. Adjusted basis is the original cost basis (the price you paid plus most of your buying closing costs, plus any capital improvements) minus all the depreciation you took or were allowed to take. That depreciation subtraction is the part people forget, and it is the part that swells the gain.
Say you bought a duplex for $340,000. The assessor split land at $90,000, so your building basis was $250,000, depreciated straight-line over 27.5 years at roughly $9,091 a year. After 12 years you have claimed about $109,000 in depreciation. Your adjusted basis is the original $340,000 minus that $109,000, which is $231,000. The land was never depreciated, so it sits in basis untouched; only the building wore down.
Net sale price, then total gain
The other half of the gain is the net sale price: the contract price minus selling costs like the agent commission, transfer taxes, and closing fees you pay. Selling costs reduce the amount realized, so they shrink the gain directly. They are not a deduction against ordinary income; they lower the number the gain is measured from.
Carry the duplex through. You sell for $470,000 and pay $30,000 in selling costs, so your net sale price is $440,000. Total gain is $440,000 minus your $231,000 adjusted basis, which is $209,000. That single figure now splits into two pieces taxed at two different rates, and the split is the entire reason a flat “capital gains rate” answer is wrong.
The two slices: recapture and long-term gain
The $209,000 divides like this:
- Unrecaptured section 1250 gain. The portion of the gain equal to your accumulated depreciation, here $109,000, is taxed at your ordinary rate but capped at 25%. At the cap that is about $27,250. This is the slice that catches people: it exists only because you took deductions, and it is taxed separately from the rest.
- Long-term capital gain. Whatever is left above your depreciation, the $100,000 of real appreciation, is long-term gain taxed at 0%, 15%, or 20% depending on your taxable income. At 15% that is $15,000.
For 2026 the long-term brackets break by taxable income: 0% at the bottom, 15% through the broad middle, and 20% only at the top. A large rental sale can push part of your gain into a higher bracket in the year you sell, so the 15% you assumed can become a blend of 15% and 20% on the top dollars. What is not on this list for a normal residential building is ordinary-income recapture. That is section 1245, and it only touches personal property and anything a cost segregation study carved into shorter classes. The full recapture mechanics get their own treatment in depreciation recapture when you sell.
The 3.8% surtax most sellers forget
On top of both slices sits the net investment income tax, a 3.8% surtax on investment income (capital gains included) once your modified adjusted gross income clears a threshold: $200,000 for a single filer and $250,000 for a married couple filing jointly. A rental sale routinely pushes a seller past those lines for the year, even if their salary alone would not, because the whole gain lands in one return.
On the duplex, if the sale puts you over the threshold, the NIIT applies to the gain caught above it. On the full $209,000 gain that is 3.8% of $209,000, or about $7,942. Stack the three numbers and the duplex sale runs roughly $27,250 of recapture plus $15,000 of long-term gain plus $7,942 of NIIT, about $50,192 in federal tax on a $209,000 gain. The headline 15% rate would have told you $31,350. The gap is the recapture and the surtax nobody mentioned. This guide makes no state tax claims; many states tax the gain too, so read your state's rules or ask your CPA before you assume the federal number is the whole bill.
What you actually walk away with
The tax is not the same as what you pocket. Net proceeds are the sale price minus selling costs minus whatever mortgage you pay off at closing, and the tax is then paid out of that. Suppose the duplex had a $180,000 loan balance. Cash at closing is $470,000 minus $30,000 of selling costs minus $180,000 payoff, which is $260,000. Set aside the roughly $50,000 of federal tax and you keep about $210,000, before any state tax. Knowing that spread ahead of time is what keeps a seller from spending proceeds that are really the IRS's.
Two moves change the tax instead of only reporting it. A 1031 exchange defers both the recapture and the gain by rolling them into a replacement property, and holding until death gives heirs a stepped-up basis, which is why inheriting a rental can wipe the gain clean in a way selling never does. The flip side is timing: if your income is unusually low in a given year, that is when the 0% and 15% brackets and the NIIT threshold work in your favor, so when you sell is itself a tax lever.
Where it gets reported, and the input it all hangs on
The sale is reported on Form 4797, with the gain flowing to Schedule D and the surtax, if any, on Form 8960. The line-by-line of that reporting is its own job, covered in the Form 4797 walkthrough. But every number on those forms hangs on one input: accumulated depreciation, the exact running total that sets your adjusted basis and sizes the recapture. In a spreadsheet that figure is reconstructed from a decade of returns, the year someone forgot to carry it forward, and a land split nobody wrote down, and that reconstruction is what goes wrong under a closing deadline. rents.ai keeps the straight-line MACRS schedule and accumulated depreciation current per property alongside loan balances and equity, so you walk into the sale already knowing your basis; it does not file Form 4797 or run the sale calculation, and the gain math here still belongs to you and your CPA. If you want to pressure-test the annual figure feeding that total, the depreciation calculator runs the same mid-month convention.
The primary sources behind all of this are Publication 544 (sales of business property), Publication 527 (residential rental property), and the instructions to Form 4797. They are dry, but they are what every other article is paraphrasing.
These are estimates to organize your year for your CPA, not tax advice. Bracket thresholds, the exact 1250 worksheet, partial personal-use, installment sales, and anything involving a prior-year fix all carry exceptions this guide skips. Bring your CPA clean records and let them make the rulings.