The Roth 401(k) contributions will count as Roth IRA contributions when you do the transfer (so they will then be freely withdrawable at any time), and the Roth 401(k) earnings will count as Roth IRA earnings (which would count as taxable income plus get a 10% early withdrawal tax if withdrawn early).
Is this true by the way?
Yes. This treatment is spelled out in A-3 of
26 CFR § 1.408A-10. It states that the portion of your Roth 401(k) rollover that is treated as "investment in the contract" as defined in A-6 of
26 CFR § 1.402A-1 counts as Roth IRA contributions for the purpose of the ordering rules, and the rest counts as Roth IRA earnings. My reading of that definition of "investment in the contract" is that it encompasses the portion of your rollover that would not count as income if you just withdrew it to your checking account instead of rolling it into another retirement account. For Roth 401(k)s, that would include your original contributions but not any earnings within the 401(k). However this is just my own interpretation of the text. I'm not a lawyer and I'm especially not
your lawyer. Please read it yourself and come to your own conclusions.
How is this tracked via tax forms?
When you make an early withdrawal from your Roth IRA you'll need to file
Form 8606 with your tax return. Part III of that form is about distributions from Roth IRAs. Here is where you report the total amount distributed, and figure how much counts as income by subtracting your basis in contributions and conversions. Particularly, on Line 22 you report your contributions. The
instructions for Line 22 include the following text:
Increase the amount on line 22 by any amount rolled in from a designated Roth account that is treated as investment in the contract.
This brings us back to what exactly the "investment in the contract" means, as discussed above.
Let's say I have $100k Roth 401k balance. It is a combination of contributions and earnings. When I roll it over to my Roth IRA, wouldn't the 1099R just show it altogether as non-taxable rollover of Roth 401k dollars? Or there are separate boxes that shows deferrals and earnings separately?
I haven't done this particular transaction before. You'll pay no tax in the year of the rollover so I'm not sure how it would be reported at that time. However your W-2s for the years when you made Roth 401(k) contributions will report your original contribution amounts, which you will eventually report as your "investment in the contract" the first time you withdraw from the Roth IRA.