Yes, you can make a direct or 60-day rollover from a 401(k) plan [or other qualified plan, 403(b) plan, or governmental 457(b) plan] to a Roth IRA, as long as you meet certain requirements.*
First, you must be entitled to a distribution from your plan. While you can always access your account when you terminate employment, in some cases you may be able to withdraw your own or your employer's contributions while you're still working (for example, at age 59½).
[Note: Your plan may also permit the "in plan" conversion of all or part of your account balance to a Roth account, regardless of whether you're eligible for a distribution from the plan. Check with your plan administrator.]
Second, your distribution must be an "eligible rollover distribution." Distributions that cannot be rolled over include hardship withdrawals, certain periodic payments, and required minimum distributions (RMDs).
Third, you must include the taxable portion of the distribution in your gross income in the year you make the rollover ("conversion"). But that's the price you have to pay to potentially receive tax-free qualified distributions from your Roth IRA in the future.
Fourth, if your distribution includes both after-tax and pre-tax dollars, you can generally direct that only the after-tax dollars be rolled over to the Roth IRA (resulting in a tax-free conversion), while making a tax-deferred rollover of the pre-tax dollars to a traditional IRA.
When evaluating whether to initiate a rollover from an employer plan to an IRA, be sure to: (1) ask about possible surrender charges that your employer plan or IRA may impose, (2) compare investment fees and expenses charged by your IRA with those charged by your employer plan (if any), and (3) understand any accumulated rights or guarantees that you may be giving up by transferring funds out of your employer plan. Also consider all of your distribution options, including leaving the money in your employer's plan, transferring the funds to a new employer's plan, or taking a cash withdrawal.
*If you make a 60-day rollover, your plan will withhold 20% of the taxable portion of your distribution for federal income tax purposes.