Depreciation recapture and capital gains on home office shed when selling house

Selling my house next spring and trying to get ahead of the tax math. I built a shed in the backyard in 2019 and have been using it exclusively as a home office ever since — took depreciation on it every year on Form 8829 and Schedule C. The shed cost about $14,000 to build and I've been depreciating it as a separate structure. I know Section 121 exclusion covers the house itself but I've seen conflicting things about whether that exclusion covers a structure like this or not. Do I have to pay depreciation recapture on the full amount I've deducted so far, plus separate capital gains treatment on any appreciation? And does it matter that the shed is physically separate from the house?

37 comments

Are you depreciating the shed as nonresidential property or residential? Because a detached structure used exclusively for business is usually depreciated over 39 years as nonresidential, not 27.5. That affects your basis calculation and how much recapture you're actually looking at.

Alex F.

Author

Honestly not 100% sure how my accountant classified it. I assumed residential since it's on my residential property but now you've got me second-guessing. I need to pull Form 4562 from each year and check.

The Section 121 exclusion issue here is real. When you have a separate structure used exclusively for business, the IRS treats the sale as two separate transactions — one for the home portion, one for the business portion. The exclusion doesn't cover the business-use portion. I ran into this with a detached studio I sold last year. I uploaded my closing docs and depreciation schedules to taxr.ai and it listed out exactly what the IRS would want to see: the allocation of sale price, the adjusted basis for the business structure, and the unrecaptured depreciation by year. Really cut through the confusion for me.

Alex F.

Author

Two separate transactions is what I was afraid of. So the shed gets its own allocated sale price, its own basis, and I report the gain separately? Do you know which form handles that — Schedule D?

The depreciation recapture part is what bites people. All the depreciation you claimed on the shed comes back as unrecaptured Section 1250 gain, up to the amount of gain attributable to that structure. Because the shed was depreciated straight-line, it isn't ordinary income, but it's taxed at up to 25% rather than the lower capital gains rate. The remaining gain above your original basis is capital gain. These two pieces go in different places on your return.

Alex F.

Author

So to be clear — the recapture amount gets reported where, exactly? I'm trying to figure out if it flows through Schedule D or somewhere else first.

The sale of the business-use portion goes on Form 4797, and the gain flows from there to Schedule D. The unrecaptured Section 1250 gain ends up on the Schedule D Unrecaptured Section 1250 Gain Worksheet. Your tax software should walk you through it once you enter the sale on 4797, but double-check the worksheet is populating.

Wait so does the shed count as a separate "property" for purposes of allocating the sale price? Like how do you even figure out what fraction of the total sale price the shed represents?

Typically an appraisal or a reasonable allocation based on FMV at time of sale. The IRS expects you to use a defensible method — an appraisal from a qualified appraiser is the cleanest documentation if the numbers are material.

Alex F.

Author

That's a good point. I was just going to estimate but maybe getting a written appraisal before closing makes more sense so I have something to stand behind.

Does the exclusive business use matter here? Like if I had used the shed personally even one day would that change everything?

Yes, significantly. Exclusive and regular business use is what qualifies it as a home office structure in the first place. If there was any personal use it likely wouldn't have qualified for home office deductions at all, and the tax treatment on sale would be different.

Had a similar situation minus the shed — I had an in-home office and when I sold the house the whole thing was under the same roof so Section 121 covered the gain, except for the depreciation I'd taken on the office, which was still taxable. Separate structure changes the analysis completely from what I understand.

Alex F.

Author

Yeah I've read that the physically separate part is what causes the two-transaction treatment. If it had been a room inside the house it would have been different.

What year did you start depreciating the shed? Just asking because if you placed it in service in 2019 and you've been taking it for several years the accumulated depreciation adds up fast on a $14k structure.

Alex F.

Author

2019 is right. So depending on the recovery period I may have taken a decent chunk of the basis down already. Need to total it up from each year's 4562.

One thing worth knowing: even if you never actually claimed the depreciation deduction in a given year, the IRS still treats you as having claimed it for recapture purposes. It's "allowed or allowable" depreciation that counts. I found this out the hard way. I had Taxr read through my prior-year depreciation schedules and it flagged two years where my preparer had understated the deduction — the recapture exposure was still there regardless because of that allowed-or-allowable rule.

Alex F.

Author

That's a scary rule. So even if I had a year where I forgot to claim it, the IRS still counts it as if I did? I had no idea.

Exactly. The adjusted basis gets reduced by depreciation allowed or allowable, whichever is greater. So underclaiming doesn't protect you from recapture — it just means you gave up a deduction for no benefit.

Is there any way to avoid the depreciation recapture entirely or is that just unavoidable once you've taken the deductions?

You can't avoid recapture on a straight sale. A 1031 exchange could defer it if you're exchanging into another business property, but you'd have to actually be selling a business asset into a qualified like-kind exchange — not straightforward in a home sale context.

Right so for most people selling their primary residence with a home office shed it's just part of the tax cost of having taken the deductions over the years.

Does your state conform to federal depreciation rules? Some states have their own depreciation calculations and the recapture amount on the state return might not match federal.

Alex F.

Author

Hadn't even thought about state. I'm in a state that mostly conforms but I should double-check the specifics. Probably another thing to run past a CPA before closing.

Before you close, seriously consider sitting down with a CPA who handles real estate — the allocation between house and shed, the Form 4797 entries, and the Schedule D worksheet interaction is a lot of moving parts. I went through a sale with business property on the lot last year and had Taxr read my draft Schedule D and 4797 side by side. It caught that the unrecaptured 1250 gain worksheet wasn't pulling the right figure from 4797, which my software had quietly gotten wrong.

Alex F.

Author

A software slip between 4797 and the worksheet is something I'd never catch on my own. I'll plan to have a CPA do the return and then maybe run the draft through Taxr myself before filing just to sanity check the worksheets.

To allocate the sale price between the house and the shed, do you use the assessed value ratio from the county tax record or does that not hold up with the IRS?

Assessed value ratios are sometimes used but they can diverge significantly from FMV, especially if the county hasn't reassessed recently. A qualified appraisal breaking out the structures separately is much cleaner and harder to dispute.

You'll want to make sure your basis records are solid too — the original construction invoices for the shed, any improvements you made to it, the placed-in-service date. All of that affects the adjusted basis calculation you use on 4797.

Alex F.

Author

I have the contractor invoice from 2019 thankfully. Need to check if I added anything to it since then — I may have put in electrical a year later and I'd need that invoice too.

Improvements to the shed after it was placed in service add to your basis. Document those separately because they might have their own depreciation history depending on how they were treated on Form 4562 each year.

Does the sale need to be reported differently if the closing happens in a different tax year than when you stop using the shed as an office?

Good question. If you stop business use before the sale, you'd stop depreciating at that point. The year of disposition is when you report the 4797 gain. The business-use percentage in the year you close matters for the final year's depreciation calculation too.

This thread convinced me to check my own situation. I have an attached garage I've been deducting as a home office for three years and now I'm wondering if the attached vs detached distinction would affect my sale treatment.

Attached structures used as home offices are generally treated as part of the dwelling unit, so the Section 121 analysis is different than for a fully separate structure. Still worth getting a CPA opinion on the specifics before you sell though.

For what it's worth I went through a similar sale two years ago without getting professional help and I ended up filing an amended return because I missed the 4797 entirely. The IRS sent a notice and it was a whole thing. Definitely get a CPA on this one.

Alex F.

Author

That is motivation enough. 4797 is not something I want to miss and have them send a notice after. CPA it is, and I'll start pulling all my 4562s from 2019 forward now.