Should I sell taxable investments with capital gains to fund Roth IRA?

Trying to figure out whether I should sell taxable investments with capital gains to fund Roth IRA contributions this year. I'm in my late 30s, decent income, and my brokerage account has a mix of positions — some are sitting on long-term gains. I don't have extra cash sitting around right now so the only way I'd fund the Roth is to sell something. My concern is the tax hit from selling the appreciated positions. I've been going back and forth: pay capital gains tax now to get money into a Roth where it grows tax-free forever, or just leave the taxable account alone and skip the Roth this year. Already maxed my 401k. Can't figure out if the math actually favors doing this or if I'm just creating a taxable event for no net benefit.

29 comments

Went through this exact decision two years ago. The key question for me was whether the gains were short-term or long-term. Short-term gains get taxed at ordinary income rates, so the drag on your contribution is much heavier. Long-term rates are lower for most people. If your positions are long-term, the tax cost of selling is a lot smaller than it feels emotionally.

Sam F.

Author

Most of mine are long-term, held over a year. That does make me feel better about the math, appreciate it.

The holding period rule is worth pinning down — if you held the stock more than one year, any gain is long-term. The IRS counts from the day after your trade date to the trade date you sell, not settlement dates. So double-check your dates if anything is borderline.

I was wrestling with this same thing last spring. I pasted my 1099-B into Taxr (taxr.ai) and it mapped out each position's gain, flagged which were short vs. long-term, and drafted a comparison showing the after-tax proceeds I'd actually be moving into the Roth vs. leaving the taxable account alone. That breakdown made the decision much clearer — I ended up selling two long-term positions and contributing the proceeds. Didn't touch the ones with big short-term gains.

Sam F.

Author

This is really helpful, I'll try that with my 1099-B to see what it actually looks like after tax before I decide.

One angle people skip: if your income is low enough in a given year, long-term capital gains can be taxed at 0%. Worth checking where your taxable income lands relative to the thresholds — the Schedule D instructions and IRS Topic 409 lay out the rate brackets without you having to guess.

Seconded. I had a year with lower income and realized I was in the 0% bracket for LTCG. Sold a chunk, funded the Roth, paid nothing on the gains. Best tax year I've had.

Sam F.

Author

I'm definitely not in 0% territory this year but good to flag for future planning.

Something else worth factoring: the Roth contribution limit applies to your contribution, not the gross proceeds from the sale. So if you sell $7,000 worth of stock that includes a gain, you can only put up to the annual contribution limit into the Roth anyway. The contribution limit is in Publication 590-A — I'd check eligibility based on your modified AGI too since the Roth phases out at higher incomes.

Sam F.

Author

Good point, I was thinking about selling just enough to cover the contribution limit, not more.

Don't forget wash sale rules don't really apply here if you're selling and moving money to a Roth — wash sales are triggered when you sell at a loss and buy substantially identical securities within 30 days. If you're selling at a gain, wash sale rules aren't your issue. Just wanted to clarify since people mix this up.

I'd think about the opportunity cost too. That money in your taxable account compounds without being taxed each year on unrealized gains. Once you harvest the gain and move it to a Roth, the future growth is sheltered but you paid tax to get in. If your time horizon is long, the shelter is worth it. If you'd need the money in a few years, maybe not. No single right answer, it really depends on your bracket now vs. expected bracket in retirement.

This is really the crux of it. The longer your Roth has to compound, the more the shelter matters relative to the entry tax cost.

Sam F.

Author

Long horizon for me, so this tilts me toward doing it. Thanks.

I sold positions in my taxable account last year specifically to fund my Roth and ran into questions about how to report everything. I uploaded my 1099-B and my draft Form 8949 to Taxr and it checked that each row was in the right Part (I vs. II), confirmed the boxes I'd checked for covered vs. uncovered securities, and flagged one position I'd put in the wrong column. Really cut down the time I spent second-guessing the form.

That's the part I always mess up — covered vs uncovered. Box A vs Box B for short-term, D vs E for long-term on Form 8949. Good reminder to double-check that.

For reporting: when you sell covered securities with gains, your broker sends a 1099-B with cost basis reported to the IRS. Those go on Form 8949 Part I (box A) for short-term or Part II (box D) for long-term, then totals flow to Schedule D. If basis is correct and no adjustments, you can skip Form 8949 for those and report directly on Schedule D line 1a or 8a under Exception 1 in the Form 8949 instructions.

Sam F.

Author

Good to know about Exception 1, that simplifies things if everything matches.

I've done this for three years running. Sell long-term gainers in January, fund the Roth for prior year by the April deadline, pay the capital gains when I file. The key for me was making sure the gain didn't push my income into a higher bracket or cause other issues — in my case it didn't, but worth modeling it out before you sell.

Worth noting that if you accidentally create a wash sale while doing this — say you sell a losing position at the same time to offset the gain, then buy back something similar — the disallowed loss gets added to the cost basis of the new shares, not permanently lost. But your 1099-B box 1g will only show the disallowed amount if the shares were covered and you bought the same CUSIP in the same account, and either way you have to report it on Form 8949 with code W in column (f) and the disallowed loss as a positive number in column (g).

Good catch. People think wash sale losses are just gone but they carry into the new shares' basis.

I'd also check whether selling bumps your modified AGI high enough to affect Roth eligibility. The capital gain flows through to your AGI, and if you're close to the Roth phase-out range, a bigger gain might reduce how much you can contribute. The Publication 590-A income limits section covers the MAGI calculation.

Sam F.

Author

Haven't thought about that, I'll run the numbers before I sell to make sure I don't phase out partially.

Also keep in mind your basis in the shares. If your broker is reporting cost basis correctly on the 1099-B it makes life easier. For uncovered securities (older positions, some inherited shares), your broker may not report basis to the IRS and you'll need your own records. Those go in box B or E on Form 8949.

For inherited shares specifically, basis is generally the fair market value at the date of death — not what the original owner paid. So those might have very little gain even if held a long time. Worth checking before assuming a big tax hit.

And inherited property is treated as long-term regardless of how long you personally held it, which is another thing people miss.

I did this last year and my CPA reminded me that selling enough to fund the Roth contribution every year is a habit worth building, but make sure you actually do the contribution before the deadline. The sale proceeds sitting in your brokerage aren't a Roth contribution until you move them into the Roth account itself.

Learned this the hard way my first year. Sold in time, forgot to actually transfer into the Roth before the deadline. Such an annoying mistake.

If you want to model the actual numbers: take your estimated long-term gain, apply your expected rate from the Schedule D Qualified Dividends and Capital Gain Tax Worksheet, subtract that from your proceeds, and that's what actually lands in the Roth. Compare that after-tax amount compounding tax-free for your horizon against the same gross amount compounding in taxable. That math tells you which side wins for your situation.