How Is Capital Gains Calculated on Sale of Rental Property?
Use this professional calculator to estimate adjusted basis, depreciation recapture, long-term or short-term federal tax, NIIT, state tax, and after-tax gain.
Rental Property Capital Gains Calculator
Tax Profile
Expert Guide: How Is Capital Gains Calculated on Sale of Rental Property?
When you sell an investment property, your tax bill is usually not based on sale price alone. The IRS framework uses a multi-step method that starts with your adjusted basis, calculates your total gain, then separates part of that gain into depreciation recapture and the remaining part into short-term or long-term capital gain treatment. If your income is high enough, additional taxes such as the 3.8% Net Investment Income Tax can apply. State income tax may also materially increase your effective tax burden. Understanding each layer before listing your property can help you estimate true after-tax proceeds and avoid unpleasant surprises at closing time.
Step 1: Determine Your Adjusted Basis
Your adjusted basis is the tax foundation of your rental property at the moment of sale. It usually starts with what you paid for the property and then changes over time. The basic framework is:
- Start with original purchase price.
- Add closing costs that are capitalizable (for example, title-related costs that are treated as basis items).
- Add capital improvements (new roof, major remodel, addition, HVAC replacement if capitalized, and similar upgrades).
- Subtract depreciation deductions taken or allowable.
That final number is adjusted basis. Many investors underestimate tax because they forget that depreciation lowers basis each year. Even if depreciation was not claimed, the IRS may treat it as allowable, which can still affect gain calculations.
Step 2: Calculate Amount Realized
Amount realized is generally sale price minus selling expenses. Selling expenses often include real estate commissions, legal fees tied directly to the sale, and transfer taxes. The formula is:
- Amount Realized = Gross Sale Price – Selling Expenses
This number is important because gain is based on amount realized, not simply contract price.
Step 3: Compute Total Gain
After you know adjusted basis and amount realized, total gain is straightforward:
- Total Gain = Amount Realized – Adjusted Basis
If this is negative, you have a loss. If positive, move to tax character analysis.
Step 4: Split Gain into Depreciation Recapture and Remaining Capital Gain
For residential rental property, depreciation usually creates unrecaptured Section 1250 gain at sale. This amount is generally taxed at a maximum federal rate of 25%. A practical planning shortcut is:
- Depreciation Recapture Portion = Lesser of cumulative depreciation or total gain
- Remaining Gain = Total Gain – Depreciation Recapture Portion
The remaining gain is then taxed under normal capital gain rules based on your holding period and taxable income. If held one year or less, gain is short-term and taxed at ordinary rates. If held more than one year, preferential long-term rates may apply.
Step 5: Apply Long-Term Capital Gain Brackets (if Applicable)
For long-term treatment, rates are not automatically 15%. The applicable rate can be 0%, 15%, or 20%, and depends on filing status plus taxable income. The taxable income stack matters because ordinary income fills lower bands first, and capital gain layers on top.
| 2024 Filing Status | 0% LT Capital Gain Up To | 15% LT Capital Gain Up To | 20% LT Capital Gain 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 |
| Married Filing Separately | $47,025 | $291,850 | $291,850 |
These bracket thresholds are widely used for planning and are published by the IRS. If your ordinary taxable income is already near or above the 15% or 20% threshold, your remaining long-term gain may be taxed at higher rates than expected.
Step 6: Check NIIT and State Tax
Many investors calculate federal capital gain and stop there. That can understate true liability. The Net Investment Income Tax adds 3.8% on the lesser of net investment income or income above the NIIT threshold. Common thresholds are $200,000 for Single and Head of Household, $250,000 for Married Filing Jointly, and $125,000 for Married Filing Separately. State taxation can also be significant, and rates vary from 0% in some jurisdictions to higher single-digit or double-digit effective rates in others depending on your state and local profile.
| Key Federal Numbers Used in Rental Sale Planning | Typical Value | Why It Matters |
|---|---|---|
| Residential rental depreciation life | 27.5 years | Determines annual depreciation deductions that reduce basis over time. |
| Commercial real property depreciation life | 39 years | Used for nonresidential assets and affects gain profile at disposition. |
| Unrecaptured Section 1250 max rate | 25% | Applies to depreciation-related gain on sale of depreciable real property. |
| Net Investment Income Tax rate | 3.8% | Additional federal tax for higher-income taxpayers. |
| Section 121 exclusion (if qualified use met) | $250,000 / $500,000 | Potential partial or full exclusion for primary residence periods under strict rules. |
Worked Example
Suppose you bought a rental for $300,000, added $8,000 closing costs to basis, made $45,000 improvements, and claimed $70,000 depreciation. You sell for $520,000 and pay $32,000 in selling expenses.
- Adjusted Basis = 300,000 + 8,000 + 45,000 – 70,000 = $283,000
- Amount Realized = 520,000 – 32,000 = $488,000
- Total Gain = 488,000 – 283,000 = $205,000
- Depreciation Recapture Portion = lesser of 70,000 and 205,000 = $70,000
- Remaining Capital Gain = 205,000 – 70,000 = $135,000
If held more than one year, recapture is taxed up to 25%, and the remaining amount is assessed at 0%, 15%, or 20% bands after considering taxable income. Then NIIT and state tax are layered in if applicable. This is why two owners with the same property and same sale price can owe very different tax amounts.
Advanced Points Investors Often Miss
- Installment sales: Timing can spread gain over years, but depreciation recapture is usually recognized sooner and does not always spread the same way as capital gain.
- Like-kind exchange history: Prior deferred gain from a 1031 exchange carries forward and can increase taxable gain when eventually sold in a taxable transaction.
- Passive loss carryforwards: Suspended passive losses may be released on a fully taxable disposition and can reduce overall tax.
- Allocation issues: Land is not depreciable, building is depreciable, and your sale contract allocation can affect final calculations.
- Improvements vs repairs: Misclassification during ownership can alter depreciation, basis, and sale-year tax.
How to Reduce Capital Gain Tax Legally
Tax reduction should be planned before sale, not at filing time after the transaction is done. Common planning tools include:
- Documented basis maximization: Keep full records of capital improvements, settlement statements, and major project invoices.
- Timing strategies: Move closing into a year with lower taxable income where feasible.
- Installment transaction design: Useful for managing bracket exposure in some scenarios.
- 1031 exchange review: Defers recognition when replacement property rules are followed.
- Primary residence conversion analysis: In specific facts, a partial Section 121 exclusion may be available, though nonqualified use rules can limit benefit.
- State residency planning: Different state systems can materially affect after-tax results, but changing domicile has strict legal standards.
Recordkeeping Checklist Before You Sell
- Final HUD-1 or closing disclosure from purchase
- Depreciation schedules from each tax return year
- Improvement invoices and permit records
- Prior refinance and title documents
- Current listing agreement and expected closing costs
- Any prior 1031 exchange documentation
- Suspended passive loss reports
Strong records can reduce risk of overpaying. If documentation is weak, it becomes harder to support higher basis or characterize expenses correctly during an IRS review.
Authoritative Sources
Use official references when validating your numbers and assumptions:
- IRS Publication 544: Sales and Other Dispositions of Assets
- IRS Topic No. 409: Capital Gains and Losses
- Cornell Law School (edu): 26 U.S. Code Section 121
Final Takeaway
Capital gains on rental property sales are calculated through a layered framework: adjusted basis first, total gain second, depreciation recapture third, and then capital gains bracket analysis with NIIT and state overlays. The complexity is manageable when broken into components. A structured calculator helps you estimate outcome quickly, but final reporting should align with your full return context, entity structure, prior carryforwards, and official tax guidance. For high-value transactions, coordinate with a CPA or tax attorney before you sign the purchase agreement so you can optimize the transaction while options are still available.