The formula
Adjusted basis = original price + capital improvements − depreciation claimed
Amount realised = sale price − selling costs
Gain = amount realised − adjusted basis
Depreciation recapture = min(depreciation, gain) × recapture rate (max 25%)
Capital gains tax = (gain − recaptured depreciation) × federal rate
NIIT = gain × 3.8% (if it applies); state tax = gain × state rate
Tax deferred = recapture + capital gains + NIIT + state
To defer it all: replacement price ≥ amount realised and reinvested equity ≥ net equity
Worked example
- You sell for $800,000 a property bought for $450,000, with $50,000 of improvements and $100,000 of depreciation claimed.
- Adjusted basis = 450,000 + 50,000 − 100,000 = $400,000.
- After $48,000 of selling costs, the amount realised is $752,000, so the gain is $352,000.
- Depreciation recapture: $100,000 × 25% = $25,000. Capital gains: $252,000 × 15% = $37,800.
- NIIT: $352,000 × 3.8% = $13,376. State tax: $352,000 × 5% = $17,600.
- A 1031 exchange defers $93,776 of tax. To defer it all, buy at least $752,000 of replacement property and reinvest the full $502,000 of equity left after repaying the $250,000 mortgage.
What a 1031 exchange does
Section 1031 of the US Internal Revenue Code lets you sell investment or business real estate and buy "like-kind" replacement property without paying capital gains tax at the time. The tax is deferred, not forgiven: your replacement property takes on the old property's low tax basis, and the gain is taxed when you eventually sell without exchanging. Investors often exchange repeatedly to keep their full equity working. If the property is still held at death, heirs generally receive a stepped-up basis, which can eliminate the deferred gain.
The rules you must follow
- Like-kind: real property held for investment or business use, exchanged for other such real property. Almost any US real estate qualifies (a rental house for an apartment block or land), but your main home and property held for resale don't.
- 45 days: identify possible replacement properties in writing within 45 days of closing the sale, usually up to three properties.
- 180 days: complete the purchase within 180 days of the sale, or by your tax return due date if that's earlier.
- Qualified intermediary: the sale proceeds must be held by an independent intermediary. If you touch the cash, the exchange fails.
Boot: what makes part of the gain taxable
To defer all the tax, the replacement property must cost at least as much as the net sale price, and you must reinvest all the equity. Anything you receive that isn't like-kind property is called boot and is taxable up to the amount of your gain. That includes cash you keep, and debt relief: if your new mortgage is smaller than the old one and you don't add cash to make up the difference. The calculator shows the minimum replacement price and equity needed.
Understanding the tax figures
Depreciation recapture: depreciation you claimed (or could have claimed) on a rental is taxed at up to 25% as unrecaptured section 1250 gain. Long-term capital gains on the rest are taxed at 0%, 15% or 20% depending on income. The net investment income tax of 3.8% applies above $200,000 of modified AGI for single filers or $250,000 for joint filers. Most states tax capital gains as ordinary income. Use our capital gains tax calculator to see how the gain falls across brackets.
Costs and alternatives
Intermediary fees typically run $750–$1,500 or more, and buying under a 45-day deadline can push you into overpaying, so the deferral is only worth it if the replacement property is a good investment in its own right. Alternatives include an installment sale, which spreads the gain over years, or a Delaware Statutory Trust for investors who want passive ownership. Other countries have different rules: the UK has limited rollover relief for business assets, and India offers exemptions under sections 54 and 54F when gains are reinvested in a residential house.
Check with a professional
1031 exchanges have strict technical rules, including related-party restrictions, holding-period expectations, and complications with partnerships and vacation homes. The figures here are estimates for planning. Before selling, talk to a qualified intermediary and a tax adviser, ideally before you sign a sale contract. Bring your settlement statements, depreciation schedules and improvement records to that meeting, because the adjusted basis drives every number in this calculation, and errors there are the most common reason estimates differ from the final tax bill.