1. 普通401(K)里的contribution,分before tax和after tax的。Before tax money, all distribution will be taxed as ordinary income (contribution + capital gani). After tax contribution will become a "tax basis". When distributed, the distributed amount will be prorated and the part of "tax basis" is not taxable.
2. Roth 401(K), if account was set up 5 years before distribution and distribution occurs after 59.5 yls, all distribution is tax free.