Oberlin24

Free tool

1031 exchange calculator: sell, hold, or exchange?

Selling a rental triggers depreciation recapture, capital gains tax, and state tax, but it also releases your suspended passive losses. This 1031 exchange calculator runs the full after-tax waterfall on a sale and compares it to deferring the gain in a 1031 exchange, the same way the Oberlin24 decision engine does.

Total Schedule E line 18 you’ve claimed (incl. improvements).
From Form 8582. Released as a deduction when you sell.
Enter your numbers above.
Net sale proceeds (after costs)
Adjusted basis
Total gain
Depreciation recapture (28.8%)
Capital gains (23.8%)
State tax (9.3%)
Estimated tax on sale
Suspended-loss release (+)
Sell: net cash in pocket
1031: reinvestable equity

Educational estimate at high-bracket default rates (recapture 28.8% = 25% + 3.8% NIIT; capital gains 23.8% = 20% + 3.8% NIIT; state 9.3%; suspended losses released at a 45% ordinary rate). Your real rates depend on your bracket and state. Not tax advice, confirm with your CPA.

How the tax on selling a rental is calculated

The rows above follow the same order the IRS does (see IRS Topic No. 409 on capital gains). Take the sale price, subtract selling costs and your adjusted basis (what you paid minus all the depreciation you have claimed), and what is left is the total gain. That gain is then taxed in two separate layers, which is why one flat “capital gains tax” rate never matches the real bill:

  • Depreciation recapture on the depreciation you took, unrecaptured Section 1250 gain at up to 25% (28.8% here, with the 3.8% NIIT).
  • Capital gains on the remaining appreciation, at the long-term rate plus NIIT (23.8% here), plus any state tax.

Not sure how much depreciation you have claimed? Estimate it with the rental depreciation calculator and enter the total above, it is the single input that moves the recapture line the most.

What a 1031 exchange defers, and the rules

A 1031 exchange rolls your sale proceeds into a like-kind replacement property and defers the whole gain, capital gains and depreciation recapture both, so you owe nothing at the time of sale. Three hard rules govern it: the replacement must be like-kind investment real estate, you identify candidates within 45 days of closing, and you close within 180 days, with a qualified intermediary holding the cash so you never touch it. Miss a deadline and the entire gain becomes taxable that year. The deferral is not forgiveness: the tax follows into the new basis and comes due when you finally sell for cash, though a step-up at death can erase it, one reason depreciation is also what lets many landlords pay little or no tax while they hold. And if a primary residence enters the picture on either end (exchanging a converted former home, or moving into the replacement later), the 1031 primary-residence rules add their own safe-harbor clocks on top of these deadlines. The official form is IRS Form 8824.

Partial exchanges and boot

You do not have to reinvest every dollar. Any cash you keep, or any drop in the mortgage you replace, is boot and is taxed in the year of sale, recapture first. A partial exchange defers most of the tax while letting you take some money off the table, run the sale both ways above to see what the boot would cost.

Your basis in the replacement property

A 1031 does not give you a fresh cost basis. The deferred gain is subtracted from what you pay for the replacement, which is how the IRS keeps score until you finally sell for cash. The formula is simple: new basis = replacement price minus deferred gain. Run it on this page's default numbers:

StepAmount
Net sale proceeds ($600,000 less 6% costs)$564,000
Adjusted basis ($400,000 paid minus $90,000 depreciation)$310,000
Deferred gain$254,000
Replacement property price$700,000
Basis in the replacement$446,000

That $446,000 splits into two depreciation tracks: the carried-over portion keeps the old property's remaining 27.5-year schedule, and only the extra money you put in (the excess basis) starts a new clock. So the trade for deferring $254,000 of gain is a smaller depreciation deduction going forward than a straight purchase at $700,000 would give you. Form 8824 walks the same math line by line.

Does a 1031 defer state tax too?

Usually yes. Most states follow the federal treatment, so the state layer above defers along with the rest. The famous exception is California's claw-back: defer California gain into an out-of-state replacement and the FTB expects Form 3840 every year afterward, and it taxes the California portion of the gain whenever you finally cash out, wherever you live by then. A few other states have similar rules. If you are exchanging across state lines, that is a question worth putting to your CPA before the 45-day clock starts.

If the property was ever your home

A home you live in is not investment property, so it cannot go into a 1031 directly. Three indirect paths work, each with its own clock:

  • Convert it to a rental first. The safe harbor in Revenue Procedure 2008-16: own it at least 24 months before the exchange, rent it at fair market value for 14 or more days in each of the two 12-month periods, and keep personal use under the greater of 14 days or 10% of the days rented. Inside those lines the IRS will not challenge the investment intent.
  • Stack Section 121 with the exchange. Sell a converted home inside the 2-of-5-year window and Revenue Procedure 2005-14 lets one sale use both. The home-sale exclusion takes up to $250,000 of gain ($500,000 married), and the 1031 defers the rest, including the rental-years depreciation that Section 121 never covers.
  • Exchange into a future home. Rent the replacement at fair value for two years before you move in. When you later sell it as your home, Section 121(d)(10) requires five years of ownership after the exchange before the exclusion applies at all, and the rental years are prorated out of it.

A worked stack: a couple bought at $400,000, lived there eight years, rented it for two, and nets $1,050,000 with $30,000 of rental-years depreciation. Total gain is $680,000. Section 121 removes $500,000. The $150,000 left over plus the $30,000 of recapture is about $44,000 of federal tax at this calculator's rates (23.8% and 28.8%), unless the sale runs through a 1031 into the next rental, which defers all of it. Drift past the 2-of-5 window and the exclusion falls away, leaving the whole $680,000 in 1031-or-taxable territory.

A duplex where you live in one unit splits the same way on one closing: Section 121 on your unit, a 1031 on the rented one, with the price allocated between them (square footage is the usual method). And if your gain already fits under the exclusion, just sell. There is nothing for an exchange to add.

Why selling sometimes beats a 1031

The reflex is to 1031 everything to defer tax. But a 1031 also means your suspended passive losses stay suspended, you don’t get to use them. An outright sale is a fully taxable disposition, which releases those losses as an ordinary deduction.

When the suspended-loss balance is large, that release can outweigh the tax you’d defer. We’ve run a real two-property portfolio where roughly $206,000 of suspended losses made selling the better move, the spreadsheet disagreed with the instinct. This tool surfaces exactly that crossover: compare the tax you’d defer against the loss release you’d trigger. If you are still holding, the other ways to reduce capital gains tax on a rental and the return on the equity you would free up both feed the decision.

Other ways to cut the tax, and which ones only defer

A 1031 is one lever of several, and most of them move the tax rather than remove it:

  • Defer: a 1031 exchange, an installment sale, or an opportunity zone fund. The tax still exists; you choose when it lands.
  • Reduce: the suspended-loss release above, capital losses taken in the same year, and the partial home-sale exclusion if you move in for 2 of the 5 years before selling. The rental years before you moved in are prorated out of that exclusion, and recapture is never excluded.
  • Remove: the basis step-up at death, which erases the gain and the recapture for your heirs, and a charitable remainder trust, which sells without immediate tax in exchange for leaving the remainder to charity.

An installment sale (you finance the buyer) reports the gain as payments arrive, which can keep each year in a lower bracket and under the 3.8% NIIT threshold. It helps least on recapture. The 25% layer on the building is spread with the payments but comes out of the earliest ones first, and ordinary recapture on appliances, carpet, furniture, and anything bonus-depreciated or cost-segregated is taxed in full in the year of sale. So it fits a sale where most of the gain is appreciation.

Holding longer does not shrink recapture either. Long-term rates apply only to the appreciation, and the depreciation comes back at up to 25% whether you held two years or twenty. Only a 1031 (defers it) or the step-up at death (erases it) gets rid of that line.

Frequently asked questions

How do I calculate capital gains tax when I sell a rental property?

Start from the sale price, subtract selling costs and your adjusted basis (what you paid minus all the depreciation you have claimed), and what is left is the total gain. That gain is taxed in two separate layers: the depreciation you took comes back as unrecaptured Section 1250 gain at up to 25%, and the remaining appreciation is taxed at the long-term capital-gains rate (0, 15, or 20%) plus the 3.8% net investment income tax and any state tax. The calculator above breaks out each layer, so you see the real number instead of a single headline rate.

How much tax does a 1031 exchange defer?

All of it, for now. A 1031 exchange rolls the entire gain, both the capital-gains portion and the depreciation recapture, into a like-kind replacement property, so you owe nothing at the time of sale. The deferred tax rides along in the new property's basis and comes due only when you eventually sell without exchanging again. Keep exchanging until death and the step-up in basis can erase it entirely.

What are the 1031 exchange rules and deadlines?

Three hard rules. The replacement must be like-kind investment real estate, you must identify candidates within 45 days of closing your sale, and you must close on the replacement within 180 days. A qualified intermediary has to hold the proceeds in between, you can never touch the cash, or the exchange fails. Miss any deadline and the whole gain becomes taxable that year.

Can I do a partial 1031 exchange?

Yes, but the part you keep is taxable. Any cash you pull out, or any drop in the mortgage you replace, is called boot and is taxed in the year of sale, usually as depreciation recapture first. So a partial exchange defers most of the tax while letting you take some money off the table. Run both the full-sale and the exchange numbers above to see what the boot would cost.

How is depreciation recapture calculated when I sell?

Every dollar of depreciation you claimed lowered your basis, so it raises your taxable gain by the same amount at sale. That slice is unrecaptured Section 1250 gain, taxed at up to 25%, separate from the capital-gains rate on the appreciation. Estimate the total you have claimed with the rental depreciation calculator, then enter it above as depreciation taken to date, that is the number that comes back at sale.

When does selling outright beat a 1031 exchange?

When your suspended passive losses are large. A sale is a fully taxable disposition, which releases those suspended losses as a deduction, while a 1031 keeps them suspended. If the loss release outweighs the tax you would defer, paying the tax and selling wins, the case most people miss. The calculator flags that crossover: we have seen roughly $206,000 of suspended losses tip a real two-property portfolio toward selling.

Can I do a 1031 exchange on my primary residence?

Not directly, because Section 1031 covers only property held for investment or business use. Convert the home to a rental first (the Revenue Procedure 2008-16 safe harbor is two years of fair-market rental with limited personal use), or use the Section 121 exclusion of up to $250,000 single or $500,000 married. A converted home sold inside the 2-of-5-year window can use both on the same sale.

Can I move into a property I got in a 1031 exchange?

Eventually. Move in right away and you undercut the investment intent the exchange depends on. Rent it at fair value for two years first, then convert. If you later sell it as your home, Section 121(d)(10) requires five years of ownership after the exchange before the exclusion is available at all, and the exclusion is prorated for the rental years.

Does an installment sale avoid depreciation recapture?

No. It spreads the gain over the years you collect payments, and the 25% layer on the building comes out of the earliest payments first. Ordinary recapture on appliances, carpet, furniture, and anything bonus-depreciated or cost-segregated is taxed in full in the year of sale, installment or not. Only a 1031 defers recapture, and only the step-up at death erases it.