Though stocks have historically outperformed bonds, if you're an older investor, or a younger one with a limited tolerance for risk, it pays to dedicate a good chunk of your portfolio to bonds. But not all bonds are the same: While you might associate the term with debt obligations issued by corporations, there are other types of bonds you might consider investing in as well -- namely, municipal bonds.

Municipals bonds are issued by cities, states, or localities to raise money for public projects or to provide funding for public services. Corporate bonds, on the other hand, are issued by companies to raise money for things like research, marketing, and expansion. Both types of bond work the same way: You invest a principal sum, collect interest income semiannually, and get your principal investment back once your bonds come due. There's just one key difference: Whereas the interest on corporate bonds is subject to taxes, municipal bond interest is always exempt at the federal level. And, if you buy bonds issued by your home state, you'll avoid state and local taxes, too.

City Hall building

IMAGE SOURCE: GETTY IMAGES.

So should you invest in municipal bonds? Here are a few questions to help you decide.

1. Do I need to lower my taxes?

Taxes are a huge problem for working Americans and retirees alike. If you're desperate for tax-friendly investments, then it really doesn't get much better than municipal bonds, because the interest they pay is always exempt from federal taxes. Furthermore, bonds issued by your home state are triple tax-exempt -- you'll avoid state and local taxes as well.

That said, corporate bonds tend to offer higher interest rates than municipal bonds, so if you're torn between two bonds (one from each category) that are comparably rated, it pays to figure out your tax equivalent yield, which is the pre-tax yield that a corporate bond must pay to equal the yield of a tax-free municipal bond. Keep in mind, however, that collecting enough taxable bond interest might push you into a higher tax bracket overall, so even if you're looking at equivalent yields, it might still pay to go with municipal bonds.

2. Am I terrified of risk?

There's no such thing as a risk-free investment, but bonds come pretty close to it. And within the world of bonds, municipal bonds are especially suitable for the risk-averse. That's because municipal bond issuers are 50 to 100 times less likely to default on their payments than corporate issuers with similar ratings. Not only that, but municipal bonds have a stronger historic recovery rate than corporate bonds. A recovery rate refers to the extent to which bondholders are made whole after a default, and in this regard, municipal bonds are the clear winner.

Again, generally speaking, bonds are a pretty low-risk investment, especially compared to stocks. But if the idea of losing money keeps you up at night, municipal bonds are probably the way to go.

3. Do I want to invest in something meaningful?

Maybe there's a company out there whose product you swear by. But in most cases, when you buy corporate bonds, what you're really doing is fueling a large company's profits and collecting a little interest on the side.

Municipal bonds, on the other hand, offer a real opportunity to invest in projects that help build and sustain communities. When you buy municipal bonds, that money might be used to revamp a park, modernize a school, or repair a local highway -- things that contribute to a better quality of life for those impacted. Therefore, if you care about what your money is being used for, you might feel better about municipal bonds over corporate ones.

As is the case with all investments, there's an upside and a downside to putting money into municipal bonds. Clearly, you'll benefit in terms of tax savings, security, and the knowledge that your money is doing something good. On the other hand, you'll have a harder time growing your wealth with municipal bonds than with stocks, so if you're younger and want to make the most of your investment dollars, you may want to look elsewhere.