What happens to un-withdrawn 401(k) funds upon the death of the account holder?
Can they be transferred to an heir? What are the tax implications (if any) of this?
A 401k plan will ask you to name a beneficiary who will receive the funds if you don't withdraw them all before death. Usually, a primary beneficiary and a secondary beneficiary is requested. If you don't specify a beneficiary, your estate is the beneficiary by default. Note that the name supplied to the 401k plan is who will get the money, and you cannot change this by bequeathing the money in your will. For example, if you neglected to change the beneficiary upon divorce, it is useless to say in your will that the money in the 401k plan goes to your new wife; the 401k plan will give it to your ex-wife who still remains the beneficiary of your 401k
Money in a 401k plan is what is called income with respect to a decedent (IRD)
on which income tax is levied, and it is also
is part of your estate and thus liable to be subject to estate tax. The
latter is true even if the 401k plan assets are not mentioned anywhere in your will,
and even if the assets got sent to your ex-wife which is not what you wanted to have
happen. There are various estate tax exceptions for spouse beneficiaries (no
estate tax due now, but will be charged when the spouse passes away). With
regard to income tax, the beneficiaries of a 401k plan (similarly IRAs,
403b plans etc) generally get to take the whole amount and pay the income
tax themselves.
Edit in response to littleadv's comments: Each 401k plan is different,
and some plans, especially the smaller ones, may prefer to distribute the
401k assets as a lump sum rather than allow the beneficiaries to withdraw
the money over several years (and pay income tax on the amount withdrawn
each year).
This is because there are far too many rules and regulations to trip over
when making withdrawals over several years.
The lump sum distribution can be transferred into a newly established
Inherited IRA (see the Nolo article linked to in @littleadv's answer
for some details and some pitfalls to avoid)
and the income tax is thus deferred until withdrawals occur. Spouse
beneficiaries are entitled to more generous rules than non-spouse
beneficiaries.
If your heirs are otherwise well provided for and you are in a philanthropic mood (or you don't want to give 'em a dime, the ungrateful... who never call, not even on Father's Day!), one way of avoiding a lot of tax is to make the beneficiary of your 401k be one or more of your favorite charities. In fact, if your testamentary inclination is to make some charitable bequests as part of your will, it is much more advantageous to give money from a tax-deferred account to the charity (size of estate is reduced, no income tax paid by anyone on amount given), and bequeath assets in non-retirement accounts to one's heirs (bequests are not taxable income, and heirs get a step up in basis for assets that have appreciated) rather than the other way around (heirs pay income tax as they withdraw the money from tax-deferred account)
Estate planning is a complicated business, and you really should talk to a professional about such matters and not rely on advice from an Internet forum.
It goes to the beneficiaries, not necessarily the heirs. Taxation is a bit complicated and depends also on the plan requirements, the new owners' decisions, and the last status of the deceased owner.
You should really talk to a tax adviser with the specific details to get a reliable answer that would address your situation. You should also ask about State inheritance taxes for the deceased and the beneficiaries' states.
Here's the NOLO article on the issue.
I understand the answers addressing the question as asked. Yes, inheriting a 401(k) can be a convoluted process. In general, it's best to transfer the account to an IRA after separation from the company to avoid the issues both of my esteemed colleagues have referenced.
Given the issue of "allowed by not required" the flexibility is greater once the account has been transferred to an IRA. With few exceptions, there's little reason to leave the account with the 401(k) after leaving that company.
(Note - I understand the original question as worded can mean the account holder passes while still working for the company. In that case, this wouldn't be an option.)