Luis Alvarez / Getty Images Taxation can be very different depending upon how and if the beneficiary is related to the deceased. A surviving spouse has the most flexibility as to what they can do with an inherited IRA or 401(k).

Roll the Account Over

A surviving spouse can elect to roll the IRA or 401(k) over into their own retirement account. All the deferred income taxes associated with the IRA or 401(k) will continue to be deferred until the surviving spouse makes withdrawals from their account. The surviving spouse can also use their own life expectancy for taking required minimum distributions (RMDs). They can choose who will receive the account at the time of their death, naming their own beneficiary.

Leave the Account Alone

A surviving spouse can continue to treat the account as the deceased spouse’s account. The benefits of this type of election work in the limited situation where the surviving spouse is younger than age of 59½ and first spouse dies well before the age of 70½, the time at which they would have to have begun taking required minimum distributions (RMDs). The surviving spouse would be hit with a 10% tax penalty if they were to begin taking withdrawals before age 59½. Leaving the account as-is allows the surviving spouse to defer taking RMDs until the deceased spouse would have been required to do so. They can then take distributions from the account without incurring the 10% early withdrawal penalty. They can roll the account over into their own retirement account when they reach age 59½.

Fund the Account into an A or B Trust

A surviving spouse can also fund the retirement account into an A or B trust if the trust was established in the deceased spouse’s estate plan prior to their death. This can occur with a beneficiary designation or a disclaimer by the surviving spouse. Income taxes will still be deferred until the surviving spouse makes a withdrawal from the account if the IRA or 401(k) becomes a part of the deceased spouse’s trust. The surviving spouse will be required to start taking RMDs calculated over their life expectancy after the account becomes part of the trust. The surviving spouse won’t be able to change the beneficiary of the account after the surviving spouse dies, however.

Estate Tax Consequences

Spouses can leave assets to each other at death free from estate taxation due to the unlimited marital deduction provided for under the federal tax code. But 100% of the fair market value of the IRA or 401(k) as of the date of the surviving spouse’s death would be included in their own estate for estate tax purposes if they were to roll it over into their own account. The value of the IRA or 401(k) would not be included in the surviving spouse’s estate if it were funded into a B trust, however.

If You’re Not the Surviving Spouse

The income tax consequences of inheriting a retirement account depends on what you choose to do with it if you’re not the surviving spouse. You have two options.

Transfer the account into an inherited IRA: You’d be required to begin taking RMDs by December 31 of the year following the deceased owner’s death if you elect this option. The distributions would be calculated over your own life expectancy. You can also take out additional amounts as needed. The amount of the distribution would be included in your taxable income in each year a distribution is taken.Cash out the account in full: The entirety of your distribution would be included in your taxable income if you choose this option.

Estate Tax for Non-Spouse Beneficiaries

The entire fair market value of the IRA or 401(k) would be included in the value of the deceased owner’s estate for estate tax purposes if the account was left to anyone other than a surviving spouse. The deceased owner’s estate would owe estate taxes if the total value of all their assets, combined with the value of the IRA or 401(k), exceeds the federal or state estate tax exemption for that year.

When the Account Must Pay Estate Taxes

It can pose a problem for the beneficiary of the IRA or 401(k) if the deceased owner’s estate is taxable and there aren’t enough assets outside the IRA or 401(k) to pay the estate tax bill, but again, this only applies to very valuable estates because of the $12.06 million exemption. Each withdrawal from an IRA or 401(k) would result in the amount being included in the beneficiary’s taxable income. It would result in more income taxes if the beneficiary needs to take additional cash out of the account to pay the estate tax bill. The only way to avoid this is to ensure that your estate has enough cash or other assets outside the retirement account to pay the estate tax bill—unless, of course, you leave the account to your surviving spouse, but this defers rather than eliminates any estate tax burden.