Because a 401k account is owned by your employer for your benefit, the assets cannot be placed in a trust. However, you can name a trust as the beneficiary for your 401k assets, as long as your spouse consents. Exercise caution, however, because naming a trust as the direct beneficiary can create complications for your heirs unless your trust fulfills certain IRS requirements.
If you are married, your spouse must be named as your primary beneficiary by federal law. Even if you name someone else, your spouse will inherit upon your death unless he has signed a waiver, agreeing to allow someone else to be named as the primary beneficiary.
When your spouse inherits, he can roll the assets into his own Individual Retirement Account, just as if he earned the money himself, and wait to make withdrawals until he reaches the age of 70 1/2. In this way, you can achieve your goal of deferring taxes, and he can still name the trust as beneficiary of his IRA upon his death.
If you want to make sure your children inherit, naming them as direct beneficiaries might still be a better option than naming a trust. You would name each child as a proportional beneficiary and, assuming the 401k rules allowed for this option, each child could then roll the assets into an Inherited IRA. How much time your children will have to defer required distributions will depend on a number of factors, including your age at the time of death. Refer to IRS Publication 590 for more information about IRS requirements for distributions from Inherited IRAs.
Trusts allow owners to exercise control beyond the grave. For example, a trust can be established that requires the beneficiaries to complete certain actions or reach a certain age before distributions are allowed. However, the IRS can disqualify any trust that is not valid in your state, does not become irrevocable upon your death, or does not name identifiable beneficiaries. If the IRS determines that your trust is not valid, your heirs could be forced to take taxable distributions sooner than you intended. Because of these potential complications, be sure to consult with an estate attorney before naming your trust as your 401k beneficiary.