Amid all the gloom and doom about forced retirement, skyrocketing healthcare costs and nest egg-cracking financial markets, there's another threat facing baby boomers: future tax liabilities.

The generation that has depended solely on 401(k)s and tax-deferred individual retirement accounts may not realize how much of a tax hit it will take when it starts withdrawing the money and living on it.

With the prospect of rising tax rates after the Bush tax cuts expire, some retirees could find themselves paying even more in taxes than they did when they were working. "It continues to surprise our clients that taxes are that big of an expense in retirement," says Mark Davis of SunTrust Investment Services, Inc.

He estimates that clients who optimize retirement withdrawals to minimize their taxes can end up with as much as 33% more to spend in retirement years than they would if they ignored the impact of taxes.

How to do that? Here are a few options.

-- Build a tax-diversified portfolio going in. If all your savings are locked away in a 401(k) or tax-deferred IRA, you will end up paying income taxes on all your withdrawals. It's better to have other accounts to pull money out of.

To really optimize your post-retirement withdrawals to minimize taxes, it would be good to have a tax-deferred account, a tax-free account (such as a Roth IRA or a healthcare savings account) and a regular taxable investment account. You can use the taxable account to take capital losses as they occur, and to keep income taxed at lower capital gains and dividend rates.

-- Consider taxes as you decide when to start your Social Security benefits. That's a complex consideration, so it's best to have an expert with a spreadsheet help you. The basic issue is this: Many advisers recommend that you delay starting your benefits as long as possible, to maximize the monthly payments you'll ultimately receive. But if you have to withdraw money from a tax-deferred account to live on while you're waiting to start Social Security, that could backfire. If your combined marginal state and local tax rate is 35%, and you're deferring $20,000 in Social Security, that could conceivably cost you as much as $7,000 a year to defer those benefits.

-- Know your limits. It's good to know your tax bracket and whether or not you are on the verge of being in a higher or lower bracket. For example, the 25% federal tax bracket starts at $35,350 in income ($70,700 for couples filing jointly)and runs all the way up to $85,650 for single filers and $142,700 for joint filers. If you have multiple accounts, you can finesse your withdrawals to keep your marginal income below a bracket line.

-- Don't forget Social Security taxes. It is likely, though not certain, that you will have to include a portion of your Social Security benefits into your taxable income. If your income, including 50% of your benefits, exceeds $25,000 for singles or $32,000 for couples, then half of your benefits will be taxable. Once that figure exceeds $34,000 for singles and $44,000 for couples, 85% of your benefits would be taxable. That means you could end up giving back as much as 21 cents in taxes for every dollar in benefits you collect.

If you can use withdrawals from tax-free accounts to keep your income below that breakpoint, that would save you money, too.

To get an idea of whether and how much of your Social Security benefits will be taxed, you can use the calculator at the website of CompleteTax (http://www.completetax.com/Widgets/free-social-security-widget.asp).

-- Optimize what you put where. Bond and bank account interest is typically taxed at higher ordinary income levels, while dividends and capital gains are taxed at lower levels, which currently max out at 15%. So match up the right investments in the right vehicle, suggests Davis. That means putting your bonds in a tax-deferred rollover IRA (or tax-free Roth)and putting your stocks in a regular taxable account.

-- Don't forget munibonds. Interest on municipal bonds is typically not subject to state and local taxes, so folks in high-tax states might find these bonds or the mutual funds that hold them attractive. And there is a bonus there: In recent topsy-turvy markets, munis have skirted, and occasionally out-yielded U.S. Treasuries. That's unusual. If you are going to invest in munis for income, don't put them in a tax-free or tax-deferred account.

-- Where you live matters. It's not just the cost of living that makes some places, such as Florida and Delaware, retiree magnets -- it's the fact that those states have much lower state tax structures. Florida has no income tax at all. If you're going to be living solely on tax-deferred withdrawals, Florida might start seeming more attractive than you ever thought it would be.

-- Remember not to let the tail wag the dog. You can have a richer retirement life if you keep taxes to a minimum, but - of course - taxes shouldn't be the driver in how you invest, where you live, or how you run your life. Use strategies like these to minimize taxes when you can, but don't make them the focal point of your retirement plan or day.

(The Stern Advice column appears weekly, and at additional times as warranted. Linda Stern can be reached at linda.stern@thomsonreuters.com; She tweets at http://www.twitter.com/lindastern .; Read more of her work at http://blogs.reuters.com/linda-stern; Editing by Gunna Dickson)