They both have a place in retirement planning. And it doesn’t have to be either/or. Ultimately, it depends on your needs and goals.
Many financial professionals recommend that you max out your 401(k) (or IRA) before investing in a deferred annuity. But when you retire, you may want to consider a rollover of a portion of your 401(k) or IRA into the purchase of an immediate annuity. That way, the bulk of your retirement savings will continue to grow in your 401(k) or IRA as you begin to take distributions. But your annuity will give you some guaranteed income in addition to Social Security.