DIY direct indexing for tax-loss harvesting to offset large capital gains — where do I even start?

Sold a rental property earlier this year and I'm staring down a significant long-term capital gain on Schedule D. My broker suggested their managed direct indexing service but the fees are steep. I've been reading about DIY direct indexing for tax-loss harvesting to offset large capital gains and it sounds like something I could manage myself — buying 40 or 50 individual S&P 500 stocks instead of SPY, then harvesting losses in the losers throughout the year. I already understand the wash sale rules in theory. What I'm less sure about is how the harvested losses actually flow through Form 8949 and Schedule D to offset the rental gain, whether short-term losses offset long-term gains, and whether trading individual stocks instead of an ETF creates any wash sale traps I'm not thinking about. Using Fidelity if that matters.

42 comments

Form 8949 is where every individual sale lands first. Short-term goes in Part I, long-term in Part II. Then Part I nets to Schedule D line 1b or 7, and Part II nets to line 8b or 15. The netting happens on Schedule D itself — short-term losses reduce short-term gains first, long-term losses reduce long-term gains first, then any remaining short-term net loss offsets long-term net gain (or vice versa). So yes, a net short-term loss from your stock harvesting can offset your long-term rental gain, but only after each bucket nets internally.

Kelly K.

Author

That netting order is what I was fuzzy on. So if I harvest enough net losses across both buckets I can chip away at the rental gain regardless of whether the stock losses are short or long term?

Exactly. The Schedule D combines them on line 16. If the total net is still a gain, you owe tax on it. If it's a loss, the deductible amount against other income is capped — check Topic no. 409 at irs.gov for the limit and carryforward rules.

The wash sale trap in DIY direct indexing is real and sneaky. If you sell Apple at a loss and buy it back within 30 days — or buy it in your IRA — the loss is disallowed. Code W goes in column (f) of Form 8949 and the disallowed amount as a positive number in column (g). The loss doesn't disappear entirely; it gets added to the cost basis of the replacement shares. But it won't help you offset your rental gain this year.

Kelly K.

Author

What about buying a different stock in the same sector? Like selling Apple and buying Microsoft immediately?

Sector swaps are the standard play. Apple and Microsoft aren't substantially identical so no wash sale. The risk is industry ETFs — if you sell a tech stock at a loss and buy a tech ETF within 30 days, the IRS position on "substantially identical" gets murkier. Most practitioners say individual stock to broad ETF is fine, individual stock to single-stock ETF is risky.

I ran into this last tax season with a big ESPP sale. Uploaded my 1099-B and a spreadsheet of all my individual stock trades to taxr.ai and it flagged three wash sale pairs I hadn't caught — two where I'd bought back in my Roth within the 30-day window. Those losses were disallowed under Publication 550's rules even though Fidelity didn't report them in box 1g, because the repurchases were in a different account and box 1g only covers same-CUSIP buys in the same account. Really changed how I tracked things going forward.

Kelly K.

Author

Did it catch the cross-account ones automatically from just the 1099-B, or did you have to give it the Roth transaction history too?

Had to upload both account statements. The 1099-B alone only shows same-account same-CUSIP wash sales per Publication 550. Cross-account ones are your responsibility to track regardless of what box 1g says.

Scale matters here. 40 to 50 stocks is manageable but you'll generate a long Form 8949. Under Exception 1 in the Form 8949 instructions, if you have covered transactions with basis reported to the IRS and no adjustments needed, those can go directly on Schedule D line 1a or 8a without listing every lot on Form 8949. That saves time. But any lot with a wash sale adjustment or a basis correction needs its own Form 8949 line.

Does that exception apply if you're using a software like TurboTax or do you still have to list everything?

Software usually populates Form 8949 for every lot by default because it imports the 1099-B. Exception 1 is more useful if you're attaching a broker's composite statement or doing it manually. Either way the tax result is the same.

Worth being clear on the holding period piece. For stocks traded on an exchange, your holding period starts the day after the trade date you bought and ends on the trade date you sell — not settlement. So if you're trying to push a lot into long-term territory, count from trade date to trade date, and you need more than one year. Exactly one year is still short-term.

Kelly K.

Author

Good reminder. I was planning to let the replacement positions season at least 13 months before harvesting again.

One thing people underestimate with DIY direct indexing is tracking lot-level cost basis across dozens of positions with multiple purchases. Fidelity does this per-account but if you ever transfer out or add manual trades you can get orphaned lots with wrong basis. That's the scenario where column (e) of Form 8949 ends up wrong and you need a basis correction with code B.

Kelly K.

Author

How do you handle basis corrections on Form 8949 when the 1099-B is wrong?

If your lot is a covered security and basis was reported to the IRS (box A or D checked), you enter the wrong basis from the 1099-B in column (e) anyway, then put code B in column (f) and correct the difference in column (g) — negative if your real basis is higher. If it's uncovered (box B or E), just put the correct basis in column (e) and zero in column (g).

Form 3921 situation reminded me of this — I had a pile of ISO exercises plus some harvested stock losses and wasn't sure how the AMT basis difference would interact with my Schedule D. Gave Taxr my Form 3921s and all my trade confirmations and it built out the regular-tax versus AMT basis comparison for each ISO lot, so I could see exactly which harvested losses would matter for regular tax and which ones shifted under AMT. Saved me from under-withholding on estimated payments.

Kelly K.

Author

Are ISO exercises relevant here? I don't have stock options, just the rental gain and the stock portfolio.

For your situation no. I brought it up because the AMT basis adjustment from Form 6251 line 2i can make a harvested loss look different for AMT purposes — matters a lot if you're in AMT territory. Since you don't have ISOs you can ignore that layer.

Publication 550 chapter 4 covers wash sales in detail including the IRA trap. The rule is explicit: if your spouse or a corporation you control buys substantially identical stock in the wash sale window, the loss is also disallowed. Easy to miss if you have joint accounts or if your spouse has their own brokerage account with overlap.

Kelly K.

Author

We have separate accounts but sometimes hold the same ETFs. That's a risk I hadn't thought about at all.

Exactly the scenario. If you sell a stock at a loss and your spouse buys the same stock within 30 days in their separate account, the wash sale rules still apply. Worth coordinating before year-end harvesting runs.

The rental gain piece — is this a Section 1231 gain or straight long-term capital gain? Depreciation recapture gets taxed differently (up to 25% rate), and that portion sits on Schedule D line 19 via Form 4797. Your harvested stock losses offset the 1231 gain but not the unrecaptured Section 1250 gain directly. Worth separating those two numbers before you decide how much harvesting you need.

Kelly K.

Author

I hadn't separated those. My CPA handles the rental side — I'll ask her to break out the recapture amount specifically so I know the actual net 1231 gain my harvesting needs to cover.

Good call. The Form 4797 flows to Schedule D and the recapture flows to the qualified dividends and capital gain tax worksheet. Your CPA will know exactly how much of the gain is sheltered by losses versus sitting at the higher recapture rate.

Practical tracking tip: run a lot-level P&L export from Fidelity monthly and flag anything down more than a threshold percentage. That way you're harvesting throughout the year rather than scrambling in December when wash sale windows are tight and you have less flexibility to swap into replacement positions.

Schedule D line 16 is the net. If that number is still positive after all your harvesting, you pay tax. If it's negative, you can deduct a limited amount against ordinary income and carry the rest forward. The carryforward keeps its character — long-term losses carry as long-term, short-term as short-term — and you use the Capital Loss Carryover Worksheet in the Schedule D instructions to figure next year's amount.

Kelly K.

Author

So any losses I don't use this year aren't wasted, they just carry forward with their character intact. That's actually useful to know if I over-harvest.

Had Taxr read through my Form 8949 from last year — 60-something rows — and compare it against my broker's gain/loss report line by line. It found two lots where the holding period was coded wrong (short-term instead of long-term) because of an account transfer that reset the acquisition date in the broker's system. I'd filed with the wrong box checked and had to amend. Worth checking carefully if you're doing high volume.

Kelly K.

Author

How common is the acquisition date reset issue on transfers?

More common than people realize when transferring between brokers via ACATS. The receiving broker sometimes uses the transfer date as the acquisition date if the cost basis data doesn't come through cleanly. Always verify the acquisition dates on the new broker's statement against your original trade confirms.

If your net capital loss ends up exceeding your capital gains after harvesting, the amount you can use against other income in one year has a cap. See Topic no. 409 at irs.gov for the exact limit — it also differs if you're married filing separately. Anything over the cap carries forward.

Box A versus Box D on Form 8949 matters for your compliance burden. Covered securities with basis reported to the IRS go in box A (short-term) or box D (long-term). Individual stocks bought after the covered security rules took effect are almost always covered. But older positions transferred in from another account might be uncovered — box B or E — and then you're responsible for proving basis if audited.

Kelly K.

Author

Fidelity shows covered/uncovered status on the 1099-B. I'll double-check any positions I transferred over from my old Schwab account a few years back.

1099-B isn't issued until February, but you don't have to wait to track your wash sales. Keep your own spreadsheet during the year — date sold, shares, proceeds, date of any repurchase, and whether the repurchase was in a different account or your spouse's account. The 1099-B will only catch same-account same-CUSIP pairs. Everything else is on you.

This is the part most people get wrong. They assume the wash sale amount in box 1g covers everything. It doesn't — it's a floor, not a ceiling.

Publication 550 is worth reading for the basis-adjustment piece of wash sales specifically. When a loss is disallowed, the disallowed amount gets added to the cost of the replacement shares. So the loss isn't permanently gone — it defers into the new position's basis and you recover it when you eventually sell those replacement shares, assuming you don't trigger another wash sale.

Kelly K.

Author

So if I never repurchase the substantially identical security again, the loss surfaces when I finally sell the replacement position. Got it — the wash sale rule defers, it doesn't destroy.

Right, with one exception: if the wash sale happened because your IRA or Roth IRA bought the substantially identical shares, the loss is permanently disallowed — it does not get added to the IRA's basis. That's the one scenario where it's truly gone.

Coming into December, also think about whether you want to realize any long-term gains intentionally. If your bracket works out such that harvested losses more than cover the rental gain, you might have room to take some long-term gains at a lower effective rate by pairing them against leftover losses. Plan the whole Schedule D picture together, not just the harvesting side.

This is the real optimization. Most people only think about cutting losses. Running the full net on Schedule D before year-end lets you make deliberate choices on both sides.