Can a loss selling my home or rental property offset capital gains?

Trying to figure out if a loss selling my home or rental property can offset capital gains before I file. Here's my situation: I sold some stocks this year at a decent gain, and I also sold a rental house I'd owned for about four years at a loss (repairs ate into everything). I also sold my primary residence at a small loss. My broker already sent the 1099-B for the stocks. I'm trying to understand whether either of those property losses can cancel out the stock gains before I end up with a big tax bill. I've read a little about Schedule D but I'm not sure which losses are even allowed to flow there. Anyone dealt with both a personal home loss and a rental loss in the same year?

39 comments

Which property did you live in and for how long? That matters a lot here because the rules are completely different depending on whether it's your personal residence vs. a rental.

Hannah C.

Author

Primary home I lived in about six years. Rental I owned four years, never lived in it myself.

So the rental loss is the more interesting one here. I had a similar situation last year and ran my closing disclosure and basis worksheet through taxr.ai — it mapped out which expenses added to basis and which were deductible repairs, then listed exactly what would flow to Schedule D vs. Form 4797. Saved me from double-counting depreciation recapture. Short answer: a rental sold at a loss does produce a deductible loss, but the depreciation you claimed (or were allowed to claim) lowers your adjusted basis and shrinks that loss; there's no recapture as ordinary income when you sell at a loss. Rental property held more than a year is Section 1231 property, so the loss goes on Form 4797 Part I, and a net 1231 loss is ordinary rather than a capital loss on Schedule D.

Hannah C.

Author

I forgot completely about depreciation recapture — I did claim depreciation every year. So some of my loss isn't really a capital loss at all?

Right. Any depreciation you took reduces your adjusted basis. So the loss you calculate might be smaller than you expect once basis is adjusted. Form 4797 Part III recapture only comes into play when you sell at a gain; a loss on a rental held more than a year goes in Form 4797 Part I as a Section 1231 loss, and a net 1231 loss is ordinary, not a capital loss on Schedule D.

Wait, can someone clarify — does the personal home loss work the same way? I thought you couldn't deduct a loss on a home you lived in.

You are correct. Losses on personal-use property like your main home are not deductible at all. That's spelled out clearly in IRS Topic 409 at irs.gov/taxtopics/tc409. It won't offset anything, unfortunately.

Hannah C.

Author

That's what I was afraid of. So the primary home loss is completely off the table.

To be precise about the rental: when you sell a rental property at a loss you report it on Form 4797 (Sale of Business Property). The loss on 4797 is generally an ordinary loss, not a capital loss, which actually can be better than a capital loss because it isn't limited by capital loss rules. But you should check whether any passive activity loss rules affect you too — if the rental was a passive activity, prior suspended losses may come into play.

Hannah C.

Author

Interesting — so the rental loss on 4797 could actually offset ordinary income, not just capital gains? I didn't realize it could be better than a capital loss.

In many cases yes. An ordinary loss from 4797 reduces AGI directly. Capital losses, by contrast, offset capital gains first; if losses exceed gains, only a limited amount per year offsets ordinary income. The Schedule D instructions and Publication 550 at irs.gov/publications/p550 walk through the interaction.

Did you take the home sale exclusion into account even though you're selling at a loss? If your gain was excluded under the two-out-of-five-year rule, that exclusion doesn't apply to losses — but it's worth confirming you even have a true economic loss after checking your adjusted basis correctly.

Hannah C.

Author

Good point. I bought the house years ago so I need to double-check whether any prior deductions affect basis.

How long did you hold the stocks you sold at a gain? Because whether those gains are short-term or long-term changes how useful any offsetting loss would be.

Hannah C.

Author

Held them about 18 months so long-term gains. Does that matter for how the rental loss offsets them?

For capital losses vs. capital gains, long-term losses offset long-term gains first, then short-term. But if the rental produces an ordinary loss on 4797, it's not going through that netting process at all — it just reduces your income directly, which is often cleaner.

Something I tripped over: depreciation you were "allowed or allowable" counts against your basis even if you never actually claimed it. So if you skipped depreciation on the rental for a year or two, the IRS still treats your basis as if you took it. That can shrink your loss on the sale significantly.

Hannah C.

Author

I had no idea about the "allowed or allowable" language. I'll need to go back and check every year I owned it.

My return last year had the same mix as yours, a rental loss and stock gains together. I uploaded my Form 4797 draft and the 1099-B to Taxr and it checked whether my Section 1231 loss from the rental was netting correctly against my other Section 1231 gains and losses for the year, which I hadn't even thought to look at. Saved me from under-reporting the loss. For Section 1231: if you have net Section 1231 losses, they're treated as ordinary losses. Net Section 1231 gains are capital gains. But nonrecaptured net 1231 losses from the last five years can "recapture" a current net 1231 gain and flip it to ordinary. Prior gains don't touch a current loss, so this only matters in a gain year. Worth checking your prior returns if you ever have one.

The five-year lookback on Section 1231 recapture, where prior net 1231 losses turn a later net 1231 gain ordinary, trips so many people up. Good catch.

Hannah C.

Author

I'll check my prior returns. I may have had a small 1231 gain two years ago from equipment I sold, but since a prior gain doesn't recapture a current 1231 loss, it shouldn't change this year's ordinary loss.

Can I ask — did you have any passive activity losses suspended from prior years on the rental? Because when you fully dispose of a passive activity, all those suspended losses release and you can use them in full in the year of sale.

Hannah C.

Author

Yes actually, I think I had suspended losses from two years where the rental showed a loss but I couldn't deduct them. That could be significant.

That's worth calculating carefully. When you fully dispose of the rental, all prior suspended passive losses free up. They flow through Form 8582 and can offset other income, not just passive income. That's a real benefit of selling.

I had suspended passive losses release when I sold my rental a couple years ago and the Form 8582 interaction with Schedule E tripped me up. I had Taxr read through my prior-year Form 8582 carryover worksheet and it listed in order exactly which losses from which years would release and how they'd flow to Schedule E and then to the front of the 1040. I reviewed the numbers myself before filing. Make sure you're pulling every prior-year 8582 — the cumulative suspended losses add up fast.

Hannah C.

Author

Thank you — I didn't even know there was a carryover worksheet inside 8582. I'll pull my prior returns and add up all the suspended amounts.

The 8582 worksheet carries a lot of information most people miss. Definitely worth pulling every year you owned the rental.

To correct something I want to flag: earlier someone implied all the rental sale flows to Schedule D as a capital loss. That's not quite right. Rental property held more than a year is Section 1231 property. The loss goes on Form 4797 first. Any Section 1231 net loss is ordinary, not capital. It does not flow to Schedule D as a capital loss. The capital loss rules — including the annual deduction limit — apply to Schedule D items, not to 1231 ordinary losses.

This is right. I should have been clearer earlier — the 4797 ordinary loss path is separate from the Schedule D capital loss path. The two don't mix unless you have a net Section 1231 gain situation where the gain ends up on Schedule D as long-term capital gain.

How do you actually report all of this on the return? I'm picturing a lot of moving pieces.

Roughly: depreciation recapture on Form 4797 Part III first, Section 1231 gain or loss flows from 4797 Part I, suspended passive losses release through Form 8582, stock gains and any capital losses net on Form 8949 and Schedule D, everything converges on the 1040. The 4797 instructions and Publication 544 walk through the sequencing.

What about the capital loss carryover rules — if after all this the stock gains exceed any capital losses you have, is there any cap on what you can use?

Capital losses in excess of capital gains can only offset a limited amount of ordinary income per year — the IRS spells out the limit in Topic 409. Any excess carries forward indefinitely. But again the rental ordinary loss from 4797 isn't subject to that limit — it's not a Schedule D item.

Given the suspended passive losses, the depreciation recapture, and the Section 1231 lookback, this return has a lot of interacting pieces. Honestly, a CPA or enrolled agent who handles real estate dispositions would be worth it for the year you sell. Getting the basis and the 8582 carryover wrong in opposite directions could easily cost more than the prep fee.

Hannah C.

Author

That's fair. I'm going to try to work through the worksheets first and then bring everything to a CPA to review before I file.

Did the 1099-B your broker sent show the correct cost basis for the stocks? Worth double-checking before you assume the capital gain number is final — brokers sometimes use average cost when you wanted specific identification, and that changes the gain.

Hannah C.

Author

Good reminder. I'll check the 1099-B box by box — I believe I specified lots when I sold but I should confirm the basis matches what I recorded.

Pulling it all together for the poster: personal home loss — not deductible, full stop. Rental loss — goes to Form 4797, generates an ordinary loss to the extent it's Section 1231 net loss, suspended passive losses release through 8582 in the year of full disposal. Stock gains net on Schedule D. The 4797 ordinary loss and the Schedule D capital gain live on different lines of the return but both reduce your overall taxable income. They don't "offset" each other in the same netting bucket, but they both work in your favor in the same tax year.

Hannah C.

Author

This summary really helped me see how the pieces fit. Pulling all prior 8582 worksheets this weekend and then booking time with a CPA.