Should I sell rental property and invest in index funds or keep renting it out?

Trying to decide whether to sell rental property and invest in index funds or keep renting it, and the tax side is what's holding me up. I bought the place in 2014 for $210k, it's worth roughly $480k now. I've been depreciating it every year on Schedule E. If I sell, I know there's capital gains to deal with but I keep reading about depreciation recapture and I'm not totally sure how that works or which form it hits. I've also seen people mention a 1031 exchange but index funds wouldn't qualify for that. Currently the rent covers the mortgage and throws off a little income. Is the tax hit on a sale as bad as I think, or am I missing deductions that bring it down? Not sure if I should be running this through a CPA or if I can figure it out myself first.

43 comments

Schedule D and Form 4797 are both in play when you sell a rental. The capital gain piece (appreciation above your original basis) goes on Schedule D. But the depreciation piece is what surprises most people — the part of your gain equal to the depreciation you claimed over the years is unrecaptured Section 1250 gain, taxed at up to a 25% maximum rate rather than the usual capital gains rates; the sale is reported on Form 4797 and the gain carries to Schedule D. Your adjusted basis isn't your purchase price anymore, it's purchase price minus all depreciation taken (or allowed, even if you forgot to take it). That can make the gain larger than you expect.

Matt T.

Author

So the sale goes on Form 4797 and the depreciation piece gets its own 25%-max calculation once it reaches Schedule D? I thought it all just flowed through Schedule D. Good to know I need to look at both.

Yes — Form 4797 reports the sale, then the gain flows to Schedule D, where the unrecaptured Section 1250 portion (max 25%) is figured separately from the remaining long-term gain. They talk to each other but they're separate calculations.

Worth pulling every year of your Schedule E to add up total depreciation claimed. Your tax software or preparer should have it, but if you've switched software or preparers you might have to dig. That cumulative number is what determines your recapture exposure. The IRS taxes recaptured depreciation on real property (Section 1250 property) at a maximum rate — look at the Unrecaptured Section 1250 Gain Worksheet in the Schedule D instructions for how that gets computed, it feeds into the Schedule D Tax Worksheet.

Matt T.

Author

I've used two different preparers and also did one year myself in TurboTax so my records are a little scattered. I'll need to piece it together.

If any year's depreciation is missing from your records, Schedule E line 18 from that year's return should show it (Form 4562 is generally only filed for the year the property was placed in service). And the IRS has transcripts you can pull to verify what was filed.

I ran my own rental sale scenario through taxr.ai before deciding. I uploaded my Schedule E history and the draft closing statement and Taxr mapped out what would hit Form 4797 versus Schedule D, then listed the adjusted basis calculation step by step so I could see exactly where the numbers came from. It didn't make the decision for me but seeing the tax picture clearly made the comparison with index fund returns a lot more concrete. Definitely worth doing before you commit to either path.

Matt T.

Author

That's the kind of breakdown I need. I keep trying to do it in my head and the depreciation recapture part keeps tripping me up.

The 1031 exchange question is real — you're right that index funds don't qualify. A 1031 lets you defer the gain by rolling into like-kind property (another investment property), not into securities. If you sell and don't reinvest in qualifying property within the exchange deadlines, the full gain and recapture are recognized in that tax year. So the comparison really is: pay tax now and invest the after-tax proceeds in index funds, or keep the property (or exchange into another one). Those are genuinely different math problems.

Matt T.

Author

Yeah the 1031 isn't really on the table for me since I want out of being a landlord. So it's really pay the tax or keep holding.

Then it comes down to your after-tax net from the sale versus your net rental yield accounting for vacancy, maintenance, and your time. A lot of landlords undercount the last two.

Net Investment Income Tax is another line to check. If your modified adjusted gross income is above the threshold for your filing status, the gain from the sale can get hit with the 3.8% NIIT on top of capital gains rates. Form 8960 is where that's computed. Rental income is also potentially subject to it depending on your level of participation. The Form 8960 instructions and Publication 550 describe what counts as net investment income.

Good point. People focus on federal capital gains rate and forget NIIT can stack on top. State tax is also a factor depending on where the property is.

Matt T.

Author

I'm in a state with income tax so yeah, state is on top of everything else. This is why the "just sell it" math is harder than it looks.

Passive activity loss rules matter here too. If you have suspended passive losses from prior years on this property (from Schedule E where losses were disallowed because your income was above the threshold), those suspended losses release and become deductible in the year you sell. That can offset some of the gain. Check your prior year returns for Form 8582 — it tracks the suspended losses.

Matt T.

Author

I think I had some years early on where the property ran at a loss but I honestly don't know if I hit the passive loss limits. I'll need to find my old 8582s.

If you're a W-2 earner making over the phase-out range, those losses were probably suspended. Finding the 8582 carryforward from your most recent return will tell you the balance.

Had a similar situation last year — multiple years of depreciation, some suspended passive losses, and I wasn't sure how they'd interact on the sale. I uploaded my last five Schedule E returns and Form 8582 to Taxr and it read through each one, matched the depreciation claimed per year, and drafted a summary of the adjusted basis and suspended loss carryforward in a format I could hand straight to my CPA. Saved a lot of back-and-forth at the billing rate.

Matt T.

Author

That's smart. If I can walk into the CPA with the numbers already organized it's probably worth it.

Agreed — coming in with your own basis calculation and the 8582 carryforward number means the CPA is verifying rather than starting from scratch. Faster and cheaper.

One thing I'd flag: the comparison between selling and investing in index funds versus holding the rental isn't just a tax question. It's also a liquidity question, a concentration question, and a leverage question. Real estate gives you leverage (your return is on the full property value, not just your equity); index funds give you liquidity and diversification. I'm not saying one is better, but the tax tail shouldn't wag the whole dog. Run the after-tax numbers, then look at the full picture.

Matt T.

Author

Fully agree. I wanted to get the tax piece right first because that's the part I can actually calculate. The other stuff I have a feel for already.

Form 4797 Part III is where residential rental property (Section 1250) goes in most sale situations. Any ordinary-income recapture from Part III goes to Part II, and the rest of the gain flows to Part I and on to Schedule D. If you used any part of the property as your main home at any point, that changes things — there's a partial home sale exclusion analysis that has to happen first under Publication 523 before the rental gain calculation. If it's always been a pure rental, ignore that, but worth confirming.

Matt T.

Author

Always been a pure rental, never lived there. So that wrinkle doesn't apply to me.

Something people miss on the index fund side: if you sell the rental and realize a large gain in one year, you might push your taxable income much higher just from the depreciation piece (taxed at your ordinary rate but capped at 25%), which then affects the rate on the capital gain too (since it's all in the same year). It's not necessarily a reason not to sell, but the year you sell matters. Some people time the sale for a year with lower ordinary income if they can.

Correct — the depreciation piece (unrecaptured Section 1250 gain) stacks on top of your W-2 or other income, taxed at your ordinary rate but capped at 25%. That can push your effective rate on it higher than you'd expect from looking at the brackets in isolation.

Matt T.

Author

I hadn't thought about timing the year. I could potentially retire in a few years at lower income. That might change the math significantly.

From a pure record-keeping standpoint: before you talk to anyone, write out the original purchase price, closing costs added to basis at purchase, any capital improvements made over the years (a new roof, HVAC, etc. — these add to basis), and total depreciation claimed. Those four things determine your adjusted basis. Capital improvements are often forgotten and each one reduces your gain dollar for dollar. Keep the receipts or at least the contractor invoices.

Matt T.

Author

I did replace the roof about five years in and redid the HVAC. Those were big numbers. Good reminder that they go into basis.

Exactly — if you have the receipts or bank records for those, make sure your preparer includes them. Missing a $15k roof replacement in the basis calc is a real cost.

When I sold my rental two years ago I wasn't sure whether my adjusted basis was right because I had capital improvements scattered across years and wasn't sure what counted. I had Taxr read through my closing disclosure, the original HUD-1, and receipts I'd scanned, and it organized everything into an adjusted basis worksheet showing purchase price, improvements, and cumulative depreciation in one place. I reviewed the worksheet and brought it to my enrolled agent. It was accurate and saved me probably an hour of their time.

Matt T.

Author

An enrolled agent is probably the right call for me too — not a full CPA firm but someone who knows the disposition rules cold.

Enrolled agents are specifically credentialed for IRS matters and rental property dispositions are well within their scope. Good choice for a one-time sale like this.

Don't overlook selling expenses — broker commission, transfer taxes, legal fees, title insurance paid by the seller. These reduce the amount realized on the sale and directly reduce your gain. They go into your gain calculation before you ever get to Schedule D or Form 4797. Sometimes people compute a scary gain number and forget to subtract $20k+ in selling costs.

Matt T.

Author

Real estate commission alone is going to be significant. I'll make sure those are in the number.

Publication 544 (Sales and Other Dispositions of Assets) is the IRS's main reference for this. It covers how to figure gain or loss on a sale of rental property, the depreciation recapture rules, and how everything flows to the right form. Worth reading the section on real property before your preparer meeting so you're not starting cold.

Yes — and Publication 551 covers basis of assets in detail, including what counts as a capital improvement versus a repair (repairs don't add to basis, only improvements do). That distinction matters when you're reconstructing your basis from memory.

Matt T.

Author

Repairs don't add to basis — that's a distinction I would have gotten wrong. Good to know before I start pulling records.

To put a bow on the tax flow: sale price minus selling expenses = amount realized. Amount realized minus adjusted basis (original cost plus improvements minus depreciation taken) = total gain. That gain splits into two pieces: the depreciation piece (unrecaptured Section 1250 gain, taxed at up to 25%) and the remaining long-term capital gain, both reported on Form 4797 and carried to Schedule D. Both can also be subject to NIIT via Form 8960 if your income is over the threshold. That's the full sequence.

Matt T.

Author

This is the clearest summary of the flow I've seen — the up-to-25% depreciation piece plus the rest of the gain, both landing on Schedule D. Saves me from piecing it together from five different IRS pages.

Worth noting that the depreciation piece can never exceed the total gain — if the property's value dropped so the gain is smaller than the depreciation taken, the whole gain is unrecaptured Section 1250 gain taxed at up to 25%, with nothing left at the lower capital gains rates. Rare with appreciation this big but good to know the rule.

Given the numbers you're describing — roughly $270k of appreciation plus years of depreciation recapture — this is large enough that I'd strongly recommend at least one meeting with an enrolled agent or CPA before you sign anything. The return year you sell in, your other income that year, state tax, NIIT, and suspended losses all interact. Getting one of those wrong on a transaction this size is expensive.

Matt T.

Author

Agreed. I wanted to understand the mechanics myself first so I'm not walking in blind, but I'm definitely not filing this one solo.