How to Calculate Gain on Sale of Rental Property
Use this premium calculator to estimate adjusted basis, total gain, depreciation recapture, capital gains tax, and net cash after estimated federal tax.
Results
Enter your numbers and click Calculate.
Educational calculator only. Tax outcomes depend on your full return, passive loss carryovers, installment sale rules, state tax law, and professional judgment.
Expert Guide: How to Calculate Gain on Sale of Rental Property
Selling a rental property is one of the biggest tax events many investors face. Unlike a primary residence sale, rental sales can trigger several tax layers at once, including depreciation recapture, long term capital gain tax, and potentially Net Investment Income Tax. The good news is that the math is systematic. Once you understand the sequence, you can estimate your gain and projected tax with confidence before listing, before accepting an offer, and before closing.
The core idea is simple: the IRS taxes your economic profit, but that profit is measured using tax basis rules, not just your cash flow. Many owners look only at purchase price versus sale price. That is not enough. You must account for basis adjustments over time, especially capital improvements and depreciation deductions. This is why two owners with the same sale price can owe very different taxes.
Step 1: Calculate your original basis
Your starting basis generally includes the amount paid for the property plus certain acquisition costs. Common components include:
- Purchase price allocated to building and land
- Settlement or closing costs that are capitalizable
- Certain legal and recording fees tied to acquisition
Not every cost at closing is added to basis. Loan points, prepaid insurance, and some financing expenses are treated differently. The most reliable approach is to use your closing statement and your tax preparer workpapers from the year of purchase.
Step 2: Add capital improvements, then subtract depreciation
After purchase, basis changes over time. Capital improvements increase basis because they extend useful life, improve function, or adapt the property to a new use. Typical examples are new roof systems, full HVAC replacements, major structural work, and complete kitchen remodels. Routine repairs generally do not increase basis.
Depreciation is the major downward adjustment. For residential rental property, the building is commonly depreciated over 27.5 years. As depreciation accumulates, adjusted basis declines. Lower adjusted basis means larger gain on sale.
Adjusted basis formula:
Adjusted Basis = (Purchase Price + Capitalizable Closing Costs + Capital Improvements) – Accumulated Depreciation
Step 3: Compute amount realized on sale
Amount realized is not just the contract sale price. You reduce gross proceeds by selling expenses such as brokerage commission, transfer taxes, title charges paid by seller, legal fees, and certain escrow costs. These selling costs directly reduce taxable gain.
Amount realized formula:
Amount Realized = Sale Price – Selling Expenses
Step 4: Determine total gain or loss
Now compare amount realized to adjusted basis.
Total gain formula:
Total Gain = Amount Realized – Adjusted Basis
If positive, you have taxable gain. If negative, you may have a loss, but deductibility depends on facts such as personal use periods and related party rules.
Step 5: Split gain into depreciation recapture and remaining gain
For most long held residential rentals, gain is split. The portion up to prior depreciation is generally unrecaptured Section 1250 gain, commonly taxed at up to 25 percent. Any remaining gain may qualify for long term capital gains rates, usually 0 percent, 15 percent, or 20 percent depending on income and filing status.
- Depreciation recapture portion: lesser of total gain or accumulated depreciation.
- Remaining gain portion: total gain minus recapture portion.
- Apply applicable rates based on holding period and income.
Step 6: Check for Net Investment Income Tax and state tax
Higher income taxpayers may owe an additional 3.8 percent Net Investment Income Tax. This can apply when modified adjusted gross income exceeds threshold amounts. Many states also tax capital gains as ordinary income, and that can materially increase your all in burden. A full projection should include federal, NIIT, and state.
Federal long term capital gains brackets for 2024
The table below summarizes commonly referenced federal long term capital gains breakpoints. Thresholds are updated over time, so always verify current values before filing.
| Filing status | 0% rate up to | 15% rate up to | 20% rate over |
|---|---|---|---|
| Single | $47,025 | $518,900 | $518,900 |
| Married filing jointly | $94,050 | $583,750 | $583,750 |
| Head of household | $63,000 | $551,350 | $551,350 |
Typical transaction cost ranges that affect gain
Selling costs can significantly reduce taxable gain. Investors sometimes miss how powerful this line item is. Below are practical ranges often seen in many U.S. markets.
| Cost category | Common range | Impact on amount realized |
|---|---|---|
| Broker commission | 4% to 6% of sale price | Direct reduction of proceeds |
| Seller closing and escrow fees | 0.5% to 2.0% | Direct reduction of proceeds |
| Transfer and recording taxes | Varies by county and state | Direct reduction of proceeds |
| Legal and document prep | $500 to $2,500+ | Direct reduction of proceeds |
Worked example
Assume you bought a rental for $300,000, had $6,000 of capitalizable acquisition costs, added $45,000 in improvements, and claimed $75,000 of depreciation. Years later you sell for $550,000 and pay $33,000 in selling expenses.
- Original basis before depreciation: $351,000
- Adjusted basis: $351,000 minus $75,000 = $276,000
- Amount realized: $550,000 minus $33,000 = $517,000
- Total gain: $517,000 minus $276,000 = $241,000
- Potential recapture: lesser of $75,000 depreciation or $241,000 gain = $75,000
- Remaining long term gain: $166,000
Then you apply your tax brackets and any NIIT exposure. This is exactly the sequence used by the calculator above.
Common mistakes that cause incorrect gain calculations
- Ignoring depreciation allowed or allowable. Even if you forgot to claim depreciation in prior years, the IRS may still treat basis as reduced.
- Mixing repairs with improvements. Repairs are usually current deductions, not basis additions.
- Forgetting selling costs. Many owners overstate taxable gain by omitting these adjustments.
- Assuming all gain gets one rate. Recapture and long term gain often face different rates.
- Overlooking passive loss carryforwards. Suspended losses may release at disposition and offset taxable income.
- Not modeling a 1031 exchange early. By closing, it is too late to retrofit exchange planning.
When a 1031 exchange may reduce immediate tax
If you are reinvesting in another investment or business property, a properly structured Section 1031 exchange may defer gain recognition. This can defer both depreciation recapture and capital gain tax, though basis carries into replacement property and tax is postponed rather than forgiven. Timing, qualified intermediary use, and identification rules are strict, so planning must happen before closing.
How financing and cash flow differ from taxable gain
Many investors are surprised that taxable gain and net cash in hand can diverge. If you pay off a large mortgage at closing, your cash proceeds may be modest while taxable gain remains high because gain is based on amount realized and adjusted basis, not loan payoff. Always run both models:
- Tax model: gain, recapture, NIIT, and estimated taxes
- Cash model: gross proceeds minus selling costs, loan payoff, taxes, and proration items
Useful IRS references
For primary rules and definitions, review IRS publications and topic pages:
- IRS Publication 544: Sales and Other Dispositions of Assets
- IRS Publication 527: Residential Rental Property
- IRS Tax Topic 409: Capital Gains and Losses
Practical checklist before you sell
- Rebuild basis from closing statement and improvement records.
- Confirm accumulated depreciation from prior returns.
- Estimate selling expenses using listing agreement and local closing custom.
- Model recapture, long term gain, NIIT, and state tax scenarios.
- Review passive loss carryovers and depreciation method history.
- Decide whether installment sale or 1031 planning is appropriate.
- Coordinate with CPA and closing attorney before contract finalization.
In short, calculating gain on sale of rental property is not difficult once you follow the right order: determine adjusted basis, calculate amount realized, measure total gain, allocate recapture, then apply tax rates. A disciplined pre sale model can prevent surprises, improve offer evaluation, and help you choose between selling, exchanging, or holding.