Advice to max out 401k first is wrong. From the
Bogleheads wiki:
Here is a general account funding priority that often works well for many people (not all points will apply to everyone):
1. Contribute to the work-based plan (401(k), 403b,) enough to get the full employer match (the match is like free money, your best possible investment)
2. Pay off high interest debt (a guaranteed high return, the next best thing to free money)
3. Contribute to a Health Savings Account (HSA) if available (unlike many other tax deductions, there are no income restrictions to contribute to an HSA)
4. Contribute the maximum to an IRA, traditional or Roth, depending on eligibility and personal circumstances
5. Contribute the remainder of the maximum employee contribution to the work-based plan
6. Contribute to a taxable investing account or use the backdoor Roth technique
7. Non-deductible IRAs or annuities
If the company plan offers good, low-cost funds, it may be preferable to contribute to the company plan before contributing to an IRA.
An investor's tax bracket may influence the decision as well: those in higher tax brackets should consider higher contributions to a tax-deferred plan (e.g. traditional 401(k) or IRA) rather than a post-tax plan (e.g. Roth 401(k) or IRA); see Traditional versus Roth for more guidance.