Calculate Tax on Sale of Rental Property
Estimate federal capital gains tax, depreciation recapture tax, NIIT, and optional state tax in one place.
Expert Guide: How to Calculate Tax on Sale of Rental Property
When you sell a rental property, the tax bill can be much more complex than a typical stock sale or a primary-home sale. Most owners know they may owe capital gains tax, but many underestimate how depreciation recapture, net investment income tax, and state rules can significantly increase the final amount due. If you are preparing to sell a rental house, condo, duplex, or multifamily building, understanding the formula in advance can help you set a better asking price, evaluate a 1031 exchange, and avoid a year-end tax surprise.
At a high level, the federal government taxes rental-property sales in layers. First, you determine your adjusted basis, which starts with your purchase price and includes certain capitalized costs and improvements, then subtracts depreciation claimed over time. Second, you calculate your amount realized, which generally equals your gross sale price minus selling costs like commissions and legal fees. Third, you calculate total gain by comparing amount realized to adjusted basis. Then that gain may be split into depreciation recapture gain and remaining capital gain. The result can involve more than one tax rate.
Step 1: Compute your adjusted basis correctly
Adjusted basis is one of the most important numbers in the entire calculation:
- Start with original purchase price.
- Add acquisition costs that are capitalized (for example, some title and recording costs).
- Add capital improvements (new roof, additions, structural upgrades, major systems).
- Subtract depreciation deductions claimed or allowable over the years.
If you claimed depreciation, your basis goes down. Lower basis usually means higher taxable gain at sale. This is why investors can owe more tax than expected even if they did not receive large annual cash flow from the property.
Step 2: Determine amount realized from the sale
Amount realized typically equals:
- Gross sale contract price
- Minus selling expenses (real estate commissions, transfer taxes, attorney fees, staging directly related to sale, and other eligible costs)
Do not confuse mortgage payoff with a tax deduction here. Paying off your loan reduces your net cash proceeds but does not directly reduce taxable gain.
Step 3: Calculate total gain or loss
Total gain formula:
Total Gain = Amount Realized – Adjusted Basis
If the number is negative, you may have a capital loss, subject to federal loss limitation rules and passive activity considerations. If positive, proceed to classify the gain.
Step 4: Split gain into depreciation recapture and remaining gain
Depreciation deductions taken during ownership are generally recaptured at sale under Section 1250 rules (often called unrecaptured Section 1250 gain). In many practical estimates, this portion is taxed at up to 25% federally.
- Depreciation recapture gain: usually the lesser of total gain or accumulated depreciation.
- Remaining gain: total gain minus recapture gain, generally eligible for short-term or long-term capital gains treatment based on holding period.
If you held the property for one year or less, the non-recapture portion is generally short-term and taxed at ordinary income rates. If held more than one year, it is usually long-term and taxed at 0%, 15%, or 20% depending on filing status and taxable income.
Federal tax rate comparison at a glance
| Tax Component | Typical Federal Rate Structure | When It Applies |
|---|---|---|
| Short-term capital gain | Ordinary income rates, up to 37% | Asset held 12 months or less |
| Long-term capital gain | 0%, 15%, or 20% | Asset held more than 12 months |
| Depreciation recapture (unrecaptured Section 1250 gain) | Up to 25% | Portion of gain tied to prior depreciation |
| Net Investment Income Tax (NIIT) | 3.8% | When MAGI exceeds threshold |
2024 long-term capital gains thresholds used in many planning models
The following federal taxable income thresholds are commonly used for planning long-term capital gains. Tax law can change, so confirm current-year limits before filing:
| Filing Status | 0% Rate Up To | 15% Rate Up To | 20% Rate Above |
|---|---|---|---|
| Single | $47,025 | $518,900 | Over $518,900 |
| Married Filing Jointly | $94,050 | $583,750 | Over $583,750 |
| Married Filing Separately | $47,025 | $291,850 | Over $291,850 |
| Head of Household | $63,000 | $551,350 | Over $551,350 |
NIIT thresholds that can add 3.8%
Many landlords miss NIIT in projections. If your modified adjusted gross income is above threshold, part of your gain can incur an additional 3.8% federal tax.
- Single: $200,000
- Married filing jointly: $250,000
- Married filing separately: $125,000
- Head of household: $200,000
For many taxpayers, the NIIT applies to the lesser of net investment income or MAGI in excess of the threshold. Because rental property gains can be large in a single year, NIIT can materially increase tax even if your base capital gains rate appears moderate.
Worked example
Suppose you purchased a rental for $300,000, had $6,000 in capitalized acquisition costs, made $40,000 in improvements, and claimed $60,000 depreciation. You sell for $550,000 with $35,000 selling costs.
- Adjusted basis = 300,000 + 6,000 + 40,000 – 60,000 = $286,000
- Amount realized = 550,000 – 35,000 = $515,000
- Total gain = 515,000 – 286,000 = $229,000
- Recapture gain = lesser of 229,000 and 60,000 = $60,000
- Remaining gain = 229,000 – 60,000 = $169,000
If long-term, most of the remaining gain may be taxed at 15% depending on your taxable income. Recapture portion can be taxed at up to 25%. Then add NIIT if income exceeds threshold, plus state tax where applicable.
Why your state taxes matter
Federal planning alone is not enough. Some states tax capital gains as ordinary income, while others offer lower or no income tax at all. For investors moving from one state to another, residency timing and sourcing rules can affect final liability. Always verify state conformity rules for depreciation, installment sales, and passive loss carryforwards. In higher-tax states, your state bill can rival or exceed NIIT.
Common mistakes that inflate the tax bill
- Forgetting prior depreciation: Your accountant may need a full depreciation schedule, including any years you self-prepared returns.
- Missing basis additions: Not all renovations are repairs. Some should be capitalized and added to basis.
- Ignoring selling costs: Valid transaction costs usually reduce amount realized.
- Assuming primary residence exclusion applies: Section 121 has strict use tests and limits, especially for former rentals.
- Ignoring NIIT: This is a frequent underestimation point for higher-income sellers.
Can you defer tax with a 1031 exchange?
In many cases, yes. A properly structured Section 1031 exchange can defer recognition of gain, including depreciation recapture, by reinvesting in like-kind real property. But compliance is strict:
- Use a qualified intermediary.
- Identify replacement property within 45 days.
- Close within 180 days.
- Follow value and equity replacement requirements to avoid taxable boot.
If you miss deadlines or receive cash boot, some gain can become taxable in the year of sale. Planning before listing is critical.
Installment sale strategy
Some sellers spread receipts over multiple tax years through installment sales, potentially smoothing recognition of gain. However, depreciation recapture is typically recognized immediately rather than deferred over the installment term. Interest and credit risk also become major considerations. This strategy may work for some investors but should be modeled carefully with a tax professional.
How this calculator helps
The calculator above is designed for planning conversations. It estimates:
- Total gain from your sale assumptions
- Depreciation recapture tax estimate
- Short-term or long-term capital gain tax estimate
- NIIT estimate based on AGI threshold logic
- State tax estimate from your chosen rate
- Total estimated tax and estimated net cash after tax and costs
It is intentionally transparent so you can test scenarios quickly, such as changing sale price, adjusting improvements, or comparing a sale this year versus next year.
Planning checklist before you sell
- Reconstruct basis file: closing statement, invoices, permits, capitalized costs.
- Request full depreciation schedule from your preparer.
- Estimate gain and tax under multiple sale prices.
- Review NIIT exposure and quarterly tax payment needs.
- Compare straight sale, 1031 exchange, and installment alternatives.
- Coordinate with state-specific rules and residency planning.
- Document selling expenses clearly for return preparation.
Authoritative references for deeper study
- IRS Publication 544: Sales and Other Dispositions of Assets
- IRS Tax Topic No. 409: Capital Gains and Losses
- Cornell Law School (LII): 26 U.S. Code Section 121
Final point: tax outcomes depend on your complete return, including losses, passive activity carryforwards, depreciation method history, and entity structure. Use this as an advanced estimator, then validate with a CPA or enrolled agent before finalizing your transaction strategy.