It depends on quite a number of factors. A few off the top of my head are:
- What would the age of the deceased have been at the time of the withdrawal? If not of retirement age, then the withdrawal is subject to taxes "and" early withdrawal penalties.
- Basically, when you receive the 1099-R for this, it's important to pay attention to detail as you work it through the TT program. You'll be asked these questions so the program can determine if a penalty is assessed or not.
No matter what you do, taxes will be paid on the withdrawn amount. "somebody" has to pay taxes on that money, since it was tax-deferred at the time it was deposited. Since the money did not go through an estate first and went directly to you, that means "you" pay the taxes. The taxes paid will depend on your total household income too, as that affects your tax bracket. I may or may not have been taxed less if run through an estate of the deceased first. It would depend on the total taxable value of the estate.
Otherwise, if the money had been paid out to the deceased person's estate, the estate would have paid the taxes and any penalties, and would have distributed the remaining amount to the designated beneficiary(s).