Does cost basis matter in a Roth IRA?

So I've been maxing out my Roth IRA for about six years and I never tracked what I actually contributed versus what the account earned. My brokerage shows a total balance but doesn't break out anything labeled "cost basis" the way my taxable account does. A friend told me cost basis doesn't matter at all in a Roth IRA because everything comes out tax-free anyway. But then I read something about ordering rules for early withdrawals and now I'm second-guessing myself. Does cost basis matter in a Roth IRA, and if so, when and for what? I'm not planning to withdraw anytime soon but I want to understand the rule before I do something that bites me later. I've looked at the Roth section in the IRA publications but the language around "basis" and "qualified distributions" is confusing me.

36 comments

The short answer is: for a qualified distribution it basically doesn't matter. But the word "basically" is doing a lot of work there. For a qualified distribution — meaning you're at least 59½ AND the account has been open at least 5 years from the first year you contributed — everything comes out tax and penalty free regardless of what you paid in. Gains, contributions, conversions, all of it. Where it gets interesting is non-qualified distributions. The IRS has an ordering rule: contributions come out first, then conversions, then earnings. So your contributions are always accessible without tax or penalty even if the account isn't "qualified" yet. But knowing the exact contribution amount matters if you ever want to prove that to the IRS.

Isaac M.

Author

That ordering rule is what tripped me up. So if I withdraw an amount equal to what I contributed over the years, I owe nothing even before the account qualifies?

Correct. Contributions are your basis in the Roth. They were already taxed. Ordering rules put them first, so a non-qualified withdrawal up to that amount doesn't get taxed again or penalized. After that, conversions, then earnings — different rules apply to each layer.

I actually had to dig into this last year when I pulled some money out early for an emergency. My brokerage's 1099-R showed a code J in box 7 which triggers the assumption that it's taxable until you show otherwise. I uploaded the 1099-R and my contribution records to taxr.ai and it walked through which lines on Form 8606 Part III applied to my situation and flagged that I'd need to carry my Roth basis forward on that form every year I had a non-qualified distribution. The rule itself: Form 8606 is how you track Roth basis with the IRS. If you don't file it, the IRS doesn't know your contributions and can treat the whole distribution as taxable.

Isaac M.

Author

Form 8606 Part III — I had no idea that form applied to Roth accounts at all. I thought it was just for nondeductible traditional IRA contributions.

Part I is for nondeductible traditional IRA contributions. Part II is for Roth conversions. Part III is specifically for Roth distributions. Three separate sections, each tracking a different thing.

Worth separating two things people mix up: 1. Cost basis as your brokerage tracks it (the price you paid for shares, for capital gains purposes) 2. Roth basis as the IRS tracks it (your total after-tax contributions to the Roth) Inside a Roth, the per-share cost basis your brokerage shows is irrelevant for tax purposes. You'll never owe capital gains on what grows inside the account. The only "basis" that matters for the IRS is the total dollar amount you contributed, which is tracked via Form 8606.

This distinction confused me for a long time. My brokerage shows cost basis on every holding inside my Roth and I kept thinking it meant something for my taxes.

Next step is ignoring that brokerage basis number for anything tax-related. It's useful internally for the brokerage's own systems but it has zero effect on what you owe the IRS when you withdraw.

One scenario where tracking your Roth contributions really does matter: Roth conversions. If you converted money from a traditional IRA and you withdrew it within 5 years of the conversion, there's a 10% early withdrawal penalty on that layer specifically (unless you're 59½ or another exception applies). Each conversion has its own 5-year clock. Form 8606 Part II captures conversions separately from regular contributions, and Part III works through the ordering. If your records are sloppy you can't prove which layer you're in.

Isaac M.

Author

I haven't done any conversions, only direct contributions. So for me the main thing is just knowing my total contributions over the years and filing 8606 if I ever withdraw early?

Exactly. Direct contributions only makes it simpler. But still keep records — your annual contribution confirmations or Form 5498 (which the IRS gets from your brokerage) are the best documentation if the IRS ever questions a non-qualified withdrawal.

Form 5498 is the one I always forget about. Your brokerage files it with the IRS every year showing contributions, rollovers, fair market value. You get a copy but it usually arrives in May after you've already filed, so people miss it. That form is part of why the IRS can cross-check whether a Roth distribution looks right. It's not a form you file yourself, just one you should keep.

I pulled money from my Roth last year thinking it was all contributions. Turned out I'd done a small conversion back in 2019 and forgot about it. The brokerage sent a 1099-R and I had no idea how to handle the five-year conversion clock or whether the amount was in the contribution layer or the conversion layer. I showed my 1099-R and the old Form 8606s I could dig up to Taxr and it read through the ordering rules line by line and drafted a completed Form 8606 Part III for me to review. I took that to my CPA who confirmed it and filed. Saved a lot of back-and-forth trying to reconstruct what I owed.

Isaac M.

Author

That's the exact scenario I'm worried about — not remembering some older transaction and getting it wrong later.

Next step honestly is just pulling every 8606 you've ever filed and checking whether Part II shows any conversions. If you've only ever made direct contributions and never filed an 8606, you may not have needed to yet — but you would if you take a non-qualified distribution.

Something that doesn't get said enough: if your Roth distribution IS fully qualified, you don't file Form 8606 for it and you don't report it on your return at all (assuming no 1099-R or a 1099-R with code Q). The form is only needed when the distribution is non-qualified. So for most people who leave the account alone until retirement, Roth basis tracking stays invisible.

Code Q on the 1099-R means qualified distribution, right? I got one last year and panicked.

Next step when you see code Q is basically nothing — that's the brokerage confirming it was a qualified distribution, no tax due, no penalty, doesn't go on your return in a way that creates liability.

The five-year rule actually has two different versions that apply in different situations and people conflate them constantly. One is for qualified distributions (the account must have been open 5 tax years). Another applies to conversions specifically for the 10% penalty. They run separately and start differently. Getting them mixed up can cost you if you withdraw a conversion too early thinking the account's overall five-year period covers it.

I work in a brokerage and the number of clients who assume Roth = totally tax-free no matter what is high. The "no matter what" is the problem. Early withdrawals of earnings before the account qualifies are both taxable AND subject to the penalty unless an exception applies. The exceptions are listed in Publication 590-B.

Isaac M.

Author

So the risk really is specifically on the earnings layer, not on contributions I already tracked.

Exactly. Contributions: always available tax and penalty free in a Roth (ordering puts them first). It's the earnings inside the account that can burn you if you're young and need the money.

My situation: inherited a Roth IRA from a parent. The five-year clock restarts? Or carries over? I've been trying to figure this out for months.

The original owner's five-year period carries over to you as a beneficiary — it doesn't restart. So if your parent's Roth was open for more than five tax years, you'd meet that part of the qualified distribution test already. But the beneficiary distribution rules have their own timing requirements separate from that. Publication 590-B covers inherited Roth rules specifically.

Tracking this thread because I'm doing a backdoor Roth and wanted to make sure I understood the basis piece. I contributed nondeductibly to a traditional IRA (Part I of 8606), converted immediately (Part II), and now I'm wondering whether my Roth basis starts from the conversion date or the original contribution date. I uploaded both my 8606s — the Part I from last year and the Part II from this year — to Taxr and had it check whether the basis was flowing correctly from one part to the next. It flagged that I had entered my prior-year basis on the wrong line in Part I, which would have made the conversion look partially taxable when it shouldn't have been.

Isaac M.

Author

That Part I prior-year basis line is exactly the kind of thing I'd get wrong. Which line was it?

Next step for anyone doing backdoor: line 2 of Form 8606 Part I is for your total basis in traditional IRAs from prior years' 8606s. If you leave it blank or enter it on the wrong line, the form calculates a taxable portion on conversion even though you should owe nothing. Easy to miss.

To put it plainly: does cost basis matter in a Roth IRA? Yes, in the sense that your total contributions are your Roth basis and you need to know that number to file Form 8606 correctly when you take a non-qualified distribution. No, in the sense that capital gains, dividends, share prices inside the account — none of that creates a tax event while the money stays in the Roth.

irs.gov/publications/p590b has the full ordering rules for Roth distributions, the five-year rule details, and the exceptions to the 10% penalty. It's dense but worth reading before you take any distribution you're not sure about.

Next step — bookmarking that. I tried reading it once and got lost but knowing to look for the ordering rules section specifically helps.

I never filed an 8606 in the years I contributed to my Roth because I thought it was only for traditional IRA situations. Reading this thread I'm now unsure whether I should have been. I haven't taken any distributions.

If you made only direct Roth contributions and took no distributions, you weren't required to file Form 8606. The form is required for nondeductible traditional IRA contributions, Roth conversions, and certain Roth distributions. Direct Roth contributions alone don't trigger a filing requirement — but keep your contribution records anyway.

That's a relief. I have all the annual confirmation emails from the brokerage and Form 5498 copies so I can reconstruct the numbers if I ever need to file Part III.

One edge case worth noting: if you ever do a recharacterization — say you contributed to a Roth and then recharacterized it to traditional — your Roth basis drops by that amount. Keeping accurate year-by-year records is the only way to catch that correctly on an 8606 years later.

To close out my own confusion from earlier in this thread: the brokerage cost basis display inside my Roth is for internal bookkeeping, not for my taxes. My Roth basis for IRS purposes is just my cumulative after-tax contributions, tracked via 8606 when triggered. Got it. Thanks everyone.