I looked at this in a previous thread: When to prefer low-rate bonds to stocks in taxable
, but I believe my conclusion there is not quite correct.
If a municipal-bond fund yields less than a stock-index fund, it may make sense to hold the bond fund in a taxable account. The municipal-bond fund presumably loses 33% of its yield to taxes (assuming it is priced at the same after-tax return as a corporate fund in a 25% tax bracket). The stock fund loses 15% of its yield to taxes every year, and about 10% of its total return to capital-gains tax. If the yields are equal and the stock fund returns a normal 8%
, this is close to break-even; the linked post has an example.
But the italicized phrase is important. In this example, the bond and stock funds have equal taxes if the stock fund returns 8%, but the stock fund has lower taxes if it returns 5% and higher taxes if it returns 11%. Thus, by putting the stock fund in your taxable account, you get the same expected return with lower risk, because the IRS will share some of your stock losses.
There is also the additional concern that you might not have to pay the capital-gains tax on the stock fund. If stock returns are high, you probably won't sell all your stock in your lifetime; you will leave some to your heirs, or give it away to charity.
But it may still make sense to hold bonds in taxable if there is a state tax issue. If you live in CA, for example, you have a 1.58% yield on CA Intermediate-Term Tax-Exempt Admiral shares with an effective tax of 0.52%, or a 1.97% yield on Total Stock Market Admiral Shares with an actual tax rate of 0.43% (0.30% federal + 0.18% state at 9.3% - 0.05% federal tax deduction from state taxes at 28%). And in any state, it's often a good idea to buy I-Bonds in taxable because they are exempt from state tax and have higher rates than TIPS held for less than twenty years.
If you do buy bonds in a taxable account, you'll want to switch to stocks in taxable if interest rates rise; this should not cause a tax problem, as rising interest rates will cause bond prices to fall and allow you to sell the bond fund for a capital loss.