Tax-advantaged places to move money from a large taxable brokerage account

I've been accumulating index funds in a taxable brokerage for about nine years and the balance is now large enough that the dividend drag and capital gains distributions every December are really starting to hurt. I'm maxing my 401(k) already and have a Roth IRA. My employer offers an HSA and a mega backdoor Roth through after-tax 401(k) contributions, neither of which I've touched. I also keep reading about I bonds and municipal bond funds but I'm not sure how they interact with my existing positions or what the actual tax math looks like. The question is: beyond the standard 401(k) and Roth, what are the tax-advantaged places to move money from a large taxable brokerage account, and in what order does it usually make sense to fill them?

42 comments

The mega backdoor Roth is probably your highest-leverage move if your plan allows it. After-tax 401(k) contributions that get rolled to a Roth either in-plan or to a Roth IRA grow tax-free forever. The IRS caps total annual additions to a 401(k) plan — employee plus employer plus after-tax — and the instructions for your plan's SPD will show the room you have above your regular deferral. Worth calling your HR or plan administrator to confirm whether in-service withdrawals or in-plan conversions are permitted.

Ben G.

Author

I checked and my plan does allow in-plan Roth conversions. I've just been ignoring that after-tax bucket for two years. Going to start sending a portion of each paycheck there immediately.

HSA is the one people sleep on most. If you have a qualifying high-deductible health plan, the HSA gives you a deduction going in, tax-free growth, and tax-free withdrawals for medical expenses — that's three layers no other account gets. You can invest the HSA balance in index funds at most custodians once it clears the minimum cash threshold. The annual contribution limits are in the HSA instructions and Publication 969, not Publication 550, since it's a health benefit rather than an investment vehicle.

Yes, and you can let medical receipts pile up for years and reimburse yourself much later — there's no deadline on reimbursement as long as the expense happened after the HSA was opened. Effectively turns it into another retirement account after age 65.

Ben G.

Author

I didn't realize there was no reimbursement deadline. I've been paying medical bills from my checking account for three years and have all the receipts. That's a meaningful lump sum I can pull out tax-free eventually.

I had a similar pile-up in my taxable account last year and ran my entire situation through taxr.ai. I uploaded my 1099-B, my year-end brokerage statement, and the summary page from my 401(k) showing the after-tax bucket balance. Taxr read through each document, identified which lots had unrealized losses I could harvest without triggering wash sales, and listed the remaining contribution room across my HSA and after-tax 401(k) in one place. It didn't tell me what to invest in, but having everything mapped out in one pass made it obvious where the unused room was. I'd had the mega backdoor available for two years and just hadn't noticed the room was there.

Ben G.

Author

This is basically exactly my situation. The idea of uploading the brokerage statement and having it cross-reference the wash sale window against my existing positions is what I've been trying to do manually in a spreadsheet.

The wash sale cross-reference is the part that gets people. You sell a loser, buy a "different" ETF that tracks the same index, and the IRS still calls it substantially identical in some cases — though the case law on that for index ETFs is genuinely unsettled.

Municipal bond funds are worth modeling if you're in a high marginal bracket. The tax-equivalent yield formula is simple: take the muni yield and divide by (1 minus your federal rate). Whether that beats a comparable taxable bond fund depends entirely on your bracket. The IRS doesn't give munis special treatment on the forms — interest still goes on Schedule B — but it's exempt from federal income tax under the tax code, not capital gains treatment.

State tax exemption on in-state munis adds another layer. If your state taxes ordinary income at a meaningful rate, buying your own state's muni fund or individual bonds can widen that advantage further.

Ben G.

Author

I'm in a high enough bracket that the muni math probably works. I hadn't thought about in-state funds — I'll check whether my state's muni yields are competitive.

One thing worth separating out: moving money out of a taxable brokerage into any of these vehicles isn't free. Selling appreciated positions to fund an HSA contribution or after-tax 401(k) means recognizing gains. The order matters. Use new cash flow first, let the taxable account sit if the positions are deeply appreciated, and only harvest from positions with losses or small gains.

Yes, exactly. The goal is redirecting new money, not liquidating. If the taxable account holds funds you've had for years with large embedded gains, the right move is usually to hold them, donate appreciated shares to charity if that fits, and fund the new buckets from salary or other liquid sources.

Donor-advised funds are worth mentioning here too. Contribute appreciated stock, take the fair market value deduction in the year of contribution, the fund sells with no capital gains, and you grant to charity over time. It doesn't eliminate tax, but it converts taxable stock into a charitable vehicle without recognizing the gain.

I bonds from TreasuryDirect earn interest that's exempt from state and local tax and you can defer federal tax until redemption or maturity. The annual purchase limit per person is set by Treasury and changes from time to time — check the TreasuryDirect site for the current figure rather than taking a number from a forum post. At current rates they may or may not beat a muni fund depending on your situation.

No, they're not going to move the needle on a large taxable account because of the purchase cap. I bonds are a decent emergency fund supplement but not really a tool for repositioning serious brokerage balances.

Ben G.

Author

That tracks. I'd been reading about I bonds as if they were a major vehicle but the purchase cap makes them more of a marginal add-on than a core strategy.

For the gains you do end up recognizing, holding period matters a lot. Publication 550 at irs.gov lays out exactly how to count the period — you start the day after acquisition and the sale date counts as a disposal day. For securities on an established market it's trade date to trade date, not settlement. Keeping short-term gains out of your taxable account is one of the reasons to use a tax-managed or buy-and-hold fund structure rather than active funds that churn positions. I ran my own 1099-B through Taxr last spring when I had a complicated mix of lots from two merged brokerages. It read the dates on each lot, flagged three positions where I'd miscounted the holding period as long-term when they were actually short-term, and drafted a corrected Form 8949 summary for me to review before I handed it to my preparer.

Ben G.

Author

The holding period counting is exactly where I've made errors before — I always want to include the purchase date in the count. Good to know trade date is what governs for securities, not settlement.

Miscounting holding period is more common than people admit. Even brokerage software sometimes shows the wrong term on a lot if there was a corporate action like a spin-off or stock split that reset the original date.

If you have stock options through your employer, ISOs in particular create their own planning puzzle. Exercising an ISO doesn't generate regular income but the spread between exercise price and fair market value is an AMT preference item that goes on Form 6251 line 2i. That adjustment can tip you into AMT, which is effectively another tax on your brokerage-adjacent activity. Worth knowing before you exercise a lot in a year when you're also doing other repositioning.

Ben G.

Author

No ISOs here, all RSUs, so the AMT piece doesn't apply to me. RSUs just land as ordinary income at vest, then anything after that is capital gain or loss on the sale.

Correct on RSUs. The vesting date FMV is your cost basis and starts the holding period clock. Hold more than a year past vest and the appreciation becomes long-term capital gain instead of ordinary income — that spread is real, especially if the stock has run.

Deferred compensation plans (nonqualified) are another option some employers offer for high earners. You elect to defer salary or bonus before you earn it, it stays out of income until distribution, and you choose the payout schedule. The tradeoff is that the money is an unsecured obligation of your employer — if the company has financial trouble you're in line with general creditors. Not the same as a 401(k) in terms of protection.

The concentration risk is real. I've seen people max out deferred comp at employers that later had liquidity problems. It's worth thinking about how much of your total financial picture is already tied to your employer before electing large deferrals.

Real estate limited partnerships and opportunity zone funds get mentioned in this context but those are illiquid, complex, and carry their own passive activity rules. Schedule K-1 reporting from a partnership is a whole separate filing season headache. I wouldn't go there just to defer taxes without understanding the underlying investment.

Yes, opportunity zone funds in particular have a specific holding-period structure to get the exclusion on appreciation — the tax benefit is real but the investment has to stand on its own. Chasing a tax deferral into a bad investment is a losing trade.

Something people miss with the taxable account: asset location, not just account type. If you have bonds or REITs producing ordinary income, holding those inside the 401(k) or IRA and keeping equity index funds in taxable is sometimes more valuable than trying to shift the money. The taxable account isn't bad — it just needs the most tax-efficient assets sitting in it.

This is the core of asset location strategy. Total return across all accounts is what matters, not optimizing each account in isolation. A bond fund in a Roth and an equity fund in taxable is usually worse than the reverse.

Ben G.

Author

I've been holding a bond allocation inside my taxable account for rebalancing convenience and I think that's exactly backwards. Moving those to the 401(k) while keeping the equity index funds in taxable would reduce the ordinary income I'm recognizing each year.

If you're charitably inclined at all, qualified charitable distributions only apply from IRAs and only after a certain age. But contributing appreciated stock directly from your brokerage to a charity or donor-advised fund — before you sell — eliminates the gain recognition entirely. The deduction is fair market value at contribution. That's in Publication 526, not 550, but it's a meaningful tool for reducing the taxable account without paying gains.

The donor-advised fund angle is especially useful here because you don't have to decide which charity gets the money immediately. You can contribute a large appreciated position in a high-income year, take the deduction that year, and distribute to charity over several years.

I want to come back to the wash sale point from earlier because it tripped me up last year. I sold a losing ETF in my taxable account and bought what I thought was a different one — same index, different provider — within 20 days. My 1099-B showed nothing in box 1g, since that box only covers replacement shares with the same CUSIP bought in the same account, but the loss was still disallowed. I hadn't realized the IRS position on substantially identical was that aggressive for index ETFs. I loaded the 1099-B into Taxr and it walked through each transaction line by line, matched the disallowed amount to the right lot, and showed me exactly how to enter code W in column (f) of Form 8949 and add the disallowed loss as a positive number in column (g). I would have entered it backwards without that walkthrough.

Ben G.

Author

The column (g) direction is the part I always second-guess. Positive means it increases your gain or reduces your loss in that column, right? So a disallowed loss goes in as a positive to cancel it out.

Yes. Column (g) is an adjustment to the gain or loss already calculated in column (h). A disallowed wash sale loss goes in as a positive number because you're adding back a loss that the rules say you can't take. The adjusted gain or loss in column (h) ends up higher as a result.

To add the form mechanics: Publication 550 confirms the disallowed loss gets added to the cost basis of the replacement shares, so it's not gone — it shifts to the new lot's basis and potentially becomes deductible when you eventually sell those replacement shares outside a wash sale window.

Has anyone compared the after-tax 401(k) in-plan conversion versus rolling to an external Roth IRA? The plan conversion keeps everything in one place but you lose flexibility on investment options, though since 2024 the lifetime RMD rules are the same for a 401(k) Roth and a standalone Roth IRA.

Actually, in-plan Roth now has the same lifetime RMD treatment as a Roth IRA — that's an important change. Roth IRAs have no RMDs during the owner's lifetime under current law, and starting in 2024 Roth 401(k) balances don't either, so you don't need to roll them out before the RMD age kicks in. Rolling to an external Roth IRA is about other advantages, not RMDs.

The investment menu is the other friction point. 401(k) plans often have a limited fund lineup and sometimes higher expense ratios than what you'd pick in an IRA. For large balances over a long horizon that difference compounds meaningfully.

To pull everything together for the original question: the typical priority order is (1) HSA if you have an HDHP, (2) mega backdoor Roth via after-tax 401(k) if the plan allows in-service conversions, (3) asset location shifts — move income-generating assets to tax-deferred or Roth, (4) tax-loss harvesting from existing positions with losses, then (5) munis or I bonds for whatever remains in taxable. That order isn't universal — your bracket, your plan's terms, and your holding periods all move things around.

Worth adding that steps 1 and 2 are funded from new money (payroll), not from selling existing positions. Steps 3 and 4 happen within the existing account without necessarily triggering anything if you're patient about it.

Yes, and step 4 — tax-loss harvesting — only matters during market dips. You can't manufacture losses in an account full of large unrealized gains. Build the habit of checking for harvestable losses after any notable market pullback rather than once a year.