Assuming that the after-tax 401(k) refers to a Roth 401(k), then yes, you can withdraw your original contributions to the Roth 401(k) tax-free and penalty-free, assuming you meet the IRS rules for Roth 401(k) rollovers, as illustrated by this example:
Bob receives a $14,000 eligible rollover distribution that is not a
qualified distribution from Bob’s designated Roth account, consisting
of $11,000 of basis and $3,000 of income. Within 60 days of receipt,
Bob rolls over $7,000 of the distribution into a Roth IRA. The $7,000
is deemed to consist of $3,000 of income and $4,000 of basis. Because
the only portion of the distribution that could be includible in gross
income (the income) is rolled over, none of the distribution is
includible in Bob’s gross income.
In this example, Bob was able to withdraw $7k of the basis without tax or penalty. However, the earnings from the Roth 401(k) would have been taxable if he had not rolled that portion over.
Generally, you can also withdraw your Roth 401(k) rollover distribution, if you meet the five-year rule for qualified distributions.
This article from Investopedia has the caveats:
From Roth 401(k) to IRA
If the rollover is to a Roth IRA instead, the holding period within
the Roth 401(k) does not carry over. That is, if the client has an
existing Roth IRA, once the Roth 401(k) distribution is in the
account, it has the same holding period as the Roth IRA funds. Let's
assume, for example, that the Roth IRA was opened in 2000. You worked
at your employer from 2006-2009 and were then let go or quit. Because
the Roth IRA that you are rolling the funds into has been in existence
for more than five years, the full distribution rolled into the Roth
IRA meets the five-year rule for qualified distributions. On the other
hand, if you did not have an existing Roth IRA and had to establish
one for purposes of the rollover, the five-year period begins the year
the Roth IRA was opened, regardless of how long you have been
contributing to the Roth 401(k).
Per this IRS Roth comparison chart, the following rules apply for Roth 401(k) distributions:
Withdrawals of contributions and earnings are not taxed provided it’s
a qualified distribution – the account is held for at least 5 years
and made:
- On account of disability,
- On or after death, or
- On or after
attainment of age 59½.
For the Roth IRA, the following rules apply:
Same as Designated Roth 401(k) Account and can have a qualified
distribution for a first time home purchase
RothIRA.com also has a list of circumstances where funds can be withdrawn tax-free and penalty free:
Qualified Distributions
- You’re totally and permanently disabled
- You’re inheriting a Roth IRA from someone else
- You’re buying a first home
Anything from the Roth IRA withdrawal that doesn’t meet the definition
of a qualified distribution is a non-qualified distribution. That
doesn’t mean, that you have no chance to escape Roth IRA early
withdrawal penalties. The IRS gives you some leeway for making
penalty-free withdrawals if:
- You’re taking a distribution to pay unreimbursed medical expenses
- You need to pay your health insurance premiums while you’re unemployed
- You’re using the money for qualified higher education expenses
- You’re taking substantially equal payments from the plan
- The withdrawal was due to a tax levy
- You’re a qualified reservist
So in summary, you need to make sure you're taking a qualified distribution from your Roth IRA, whether or not it contains funds from a rolled-over Roth 401(k). Make sure you consult with your accountant/tax professional to make sure your plans comply with IRS rules for qualified distributions.