Lawful 401K plans are considered business investments. Hence the money invested does not come under the definition of being a debt and thus Zakah is necessary each year as long as the total amount (along with any other savings a person has, excluding any debts) meets the Zakah quantum [Nisāb] which is approximately $150. One is obliged to pay 2.5% on the total value of one's investments (which includes one's own investment, along with any amount added by one's employer that has vested [i.e. the money is now considered the employees since some companies release the amounts contributed by themselves in installments so the employees cannot take the whole amount at once], and any gain or profits that have since been accumulated. In other words the Zakātable amount will be the amount a person would consider his or hers at that time even if he was to leave his employment.
For instance, if a person's total personal investments in his or her 401K plan are $5,000.00 along with $2,500.00 matched by the employer, then the Zakāt will be 2.5% of $7,500.00 which is $187.50 for that year.
If he or she has an additional $2,500.00 in other zakātable assets like cash in hand or inventory, etc. then the total zakātable income is $10,000.00, hence, his Zakah will be $250.00 for that year.
Any penalty amount or taxes that one would have to pay if they did a premature withdrawal of their investment are not exempted from the total zakātable assets each year, unless a person makes such a withdrawal or cancels his or her plan. In this case he or she would only pay zakāt on the amount left on the day the zakāt becomes due after deducting any penalties or taxes.
And Allah knows best.
Mufti Ikram ul Haq
Fatwa Center of America