In your fight to save for a comfortable retirement, tax-favored retirement accounts can be one of your strongest allies. But sometimes, the right move is to steer clear of your retirement accounts, choosing instead to use alternatives that match up more closely with your particular goals.

The ins and outs of retirement accounts
When it comes to beating taxes, retirement accounts seem like a dream. With traditional IRA and 401(k) accounts, you can get an up-front deduction against your income tax that can amount to thousands in savings on your tax bill. A Roth IRA or 401(k) contribution doesn't give you an immediate tax deduction, but what it does give you can be even more valuable: tax-free treatment on the account's income and capital gains for as long as you keep your money inside the Roth.

On top of the financial benefits of retirement accounts comes a very practical additional benefit: easier recordkeeping. With investments outside your retirement accounts, you have to constantly keep track of purchases and sales in order to keep your taxes as low as you can. But with IRAs and 401(k)s, the tax-deferred nature of those retirement accounts makes buying and selling stocks and other investments completely unimportant. That, in turn, will make your life a lot easier at tax time.

When to stay out
But just because those benefits are there doesn't mean that investing in a retirement account is always your best bet. Here are some warning signs to look out for that might point you in a different direction:

1. When your employer gives you a raw deal.
The best 401(k) plans match a portion of your contributions. When you have an employer match, it almost always pays to contribute at least enough to max it out; that's free money that you shouldn't pass up.

But with some plans, high costs that can include both administrative fees as well as the management costs of the underlying investments can make it more expensive than it's worth to participate in your 401(k). Consider: if all you have in your 401(k) are high-priced mutual funds charging 1% to 2% annually, high fees will cost you a big portion of your long-term returns. By contrast, if you go outside your 401(k) to find lower-cost choices, the savings will go a long way toward making up for the tax benefits of staying inside your employer plan.

2. When you have high-cost debt.
Saving for retirement is important. But if you're paying 15%, 20%, or even more in interest on credit card debt, you have to get your priorities straight. In an environment where bonds are paying 3.5% or less and stock returns are expected to be weak at best, getting the certain return from paying down high-interest debt is about the best deal you can get.

3. When you're going to buy high-growth stocks and hold them for the long term.
Traditional retirement accounts and 401(k)s are best for conservative stocks that have healthy flows of what would ordinarily be taxable income. So if you're looking to own high-yielding mortgage REITs like Annaly Capital (NYSE: NLY) or Chimera Investment (NYSE: CIM), having them in an IRA is a really smart move. The same goes for more traditional high-yield stocks like Frontier Communications (NYSE: FTR) or Diamond Offshore (NYSE: DO); having those stocks in retirement accounts lets you avoid taxes on dividends year in and year out.

But if you plan to buy growth stocks and hold them for the long run, you might do better in a taxable account. That's because favorable capital gains rates apply to taxable accounts but not to withdrawals from retirement accounts. So for stocks like Green Mountain Coffee Roasters (Nasdaq: GMCR), lululemon athletica (Nasdaq: LULU), or Melco Crown Entertainment (Nasdaq: MPEL) -- each of which has delivered superior growth in recent years and seem poised to continue their winning ways -- you might want to get them into a taxable account to take advantage of lower maximum capital gains rates.

4. When other account choices are even better.
Some people advise using Roth IRAs for other purposes, such as saving for your children's college education. But for education, 529 college savings plans do a better job, giving you tax-free treatment without using up money you should be saving for retirement.

Be flexible
Retirement saving is one of the most important things you'll do with your investments. But it isn't the only thing. Often, the best solution is to keep some of your savings outside retirement accounts to take advantage of opportunities where IRAs and 401(k)s just don't work as well.

Dividend stocks with high yields often work best in an IRA. To find 13 good prospects, take a look at the Fool's special free report on high-yielding dividend stocks and get started investing today.