Retirement tax questions

It's my understanding that any contributions to my 401(k) Roth (shown in box 12 w/code AA) would not be included in my Roth IRA contributions.  Therefore, if over 50 years old, I can contribute the max 6,500 to a Roth IRA AND contribute to a Roth 401(k) without a penalty.  Is my understanding correct?