I will post the rules from the IRS website below. Before I post, I wanted to say that the advice provided by aalba005 is correct. Based on the tax rules, there is a 10% early withdrawal penalty from 401k plans and other non IRA plans with no higher education exemption. However, if you roll-over the 401k or other retirement plan into a Roth IRA or traditional IRA there is an exemption for the 10% penalty on higher education expenses. So it seems like with many tax/accounting questions the answer is a Yes and No depending on the circumstances. Yes - Penalty for 401k, No - Penalty for Roth IRA/IRA. Here are the links to the IRS topic discussions
Topic 558 - Additional Tax on Early Distributions from Retirement Plans, Other Than IRAs
https://www.irs.gov/taxtopics/tc558.htmlTopic 557 - Additional Tax on Early Distributions from Traditional and ROTH IRAs
https://www.irs.gov/taxtopics/tc557.html