Founded in 1993 by brothers Tom and David Gardner, The Motley Fool helps millions of people attain financial freedom through our website, podcasts, books, newspaper column, radio show, and premium investing services.

Municipal bonds work just like corporate bonds, only they're issued by cities, states, and counties instead of large companies. Here's what you need to know about investing in municipal bonds.

Though stocks have long been touted as investors' big ticket to wealth over time, that doesn't mean bonds shouldn't have a place in your portfolio. The advantage of bonds is that they're considered a relatively safe investment, especially when compared to stocks. Not only do bond values tend to fluctuate less frequently and drastically than stock values, but because bonds pay interest (at least most of the time), they're considered a fairly reliable source of ongoing income.

Now when we think about bonds, our minds often jump to those of the corporate variety. But it's not just large corporations that issue bonds; municipalities like states, cities, and counties issue them, too. As such, there's a large market for investing in municipal bonds, or "muni" bonds. And while the extent to which you'll make money from municipal bonds will depend on factors such as the interest rate you can get, there are plenty of good reasons to add them to your portfolio.

Image source: Getty Images.

Here, we'll tell you everything you need to know about investing in municipal bonds. Specifically, we'll talk about the types of municipal bonds you can buy (general obligation versus revenue), the tax benefits of municipal bonds, and the steps you can take to ensure that you're choosing the right bonds for your portfolio.

History of municipal bonds

A municipal bond is a debt security issued by a state or municipality to fund public works. The first official municipal bond on record was issued by New York City in 1812 to pay for the digging of a canal. Since then, the size of the U.S. municipal bond market has grown to roughly $3.9 trillion. Some notable landmarks financed by municipal bonds include the Erie Canal and San Francisco's Golden Gate Bridge.

How municipal bonds work

Municipal bonds work similarly to corporate bonds in how they're structured, though they differ in many ways that we'll dive into in a bit. A bond is a debt instrument issued to raise capital. In the case of corporate bonds, companies are the issuers. Municipal bonds are issued by individual states, cities, counties, and districts. Either way, when you buy a bond (municipal or otherwise), you're agreeing to invest a certain amount of money, known as your principal, over a predetermined period of time. The issuer then agrees to pay that investment back once the bond matures, or comes due. Meanwhile, you, the investor, get to collect interest payments twice a year for as long as you hold your bonds.

For example, you might buy a 10-year, $15,000 bond paying 4% interest. The issuing municipality, in return, will promise to pay you interest on that principal every six months at 4% and then return your original $15,000 once that 10-year period is up.

But here's where municipal bonds differ from corporate bonds: With the latter, the interest payments you collect are subject to taxes. Municipal bonds, however, are always exempt from federal taxes. Furthermore, if you buy bonds issued by the state you live in, your interest payments are exempt from state and local taxes as well. Additionally, bonds issued by U.S. territories such as Puerto Rico and Guam are also triple-tax exempt.

How to make money from municipal bonds

There are two ways to make money from municipal bonds. The first is via the interest payments we just discussed. Imagine you buy a 10-year bond. If you hold it until it matures in a decade, you'll collect 20 interest payments over the life of that bond, which means that even though you're getting the same principal investment back upon maturity, you'll have profited by virtue of that interest.

The second way to make money from municipal bonds is to sell them at a price that's higher than what you paid for them initially. Imagine you buy $15,000 in muni bonds at face value, which means you pay exactly $15,000 for them. If the market value of those bonds then increases to $17,000, and you sell at that price, you profit to the tune of $2,000. Another possibility is that you buy those $15,000 in bonds at a discount -- meaning, at a price below their face value. If their value then climbs back up to $15,000, you get to keep the difference.

Types of municipal bonds

Municipal bonds come in two varieties: general obligation bonds and revenue bonds. General obligation bonds are used to finance public projects that aren't linked to a particular revenue stream. Revenue bonds, by contrast, are used to finance public projects with the potential to make money. There are advantages and drawbacks to investing in each type of municipal bond.

General obligation bonds

General obligation bonds are used to fund public projects that don't make money but better the communities they serve. A city might issue general obligation bonds to build a park or improve a school system, for example. These projects won't be money-makers, but they'll improve the lives of the people who live in that city.

General obligation bonds are backed by the full faith and credit of the issuer. This means that if a city issues municipal bonds, it must do everything in its power to meet its obligations to bondholders. As such, a city might, in theory, have to raise local taxes in order to cover interest payments on its outstanding bonds.

Because of this, general obligation bonds are generally considered a safer investment than revenue bonds, and historically, they've been less likely to default, i.e., fail to pay on schedule. That said, before buying general obligation bonds, you should research the issuing municipality's credit rating to ensure that it's reasonably strong. (We'll talk more about that in a bit.)

Revenue bonds

Revenue bonds are issued by municipalities to finance projects that have the potential to make money. Whereas general obligation bonds are backed by the full faith and credit of the issuer, revenue bonds are backed by the income streams they're tied to.

A city might, for example, issue revenue bonds to fund the construction of a high-speed toll road. The money collected in tolls could then be used to generate revenue, thereby enabling the city to repay its bondholders.

From an investor perspective, revenue bonds are somewhat easy to vet, since they're tied to a specific money-making venture. That said, revenue bonds have higher default rates than general obligation bonds, and it's still important to research the issuer's credit rating before moving forward.

How to invest in municipal bonds

Unlike stocks, which trade on public exchanges, municipal bonds don't trade on a centralized exchange. Rather, they trade in a manner known as over the counter, which means transactions are conducted directly between two private parties.

Generally, if you want to purchase individual municipal bonds, you'll need to find a broker who can locate the bonds you want and sell them to you. But because municipal bonds aren't regulated the same way stocks are, you might find that you're charged a steep markup, which means your broker sells you bonds at a price much higher than what he or she paid, in addition to whatever commission or fee that broker collects. That said, brokers who buy and sell municipal bonds are required to register with the Municipal Securities Rulemaking Board (MSRB), which governs the muni bond market. And as such, they're required to disclose certain pricing information so that you, as an investor, can understand what sort of markup you're looking at.

An additional challenge in buying individual municipal bonds is that there's often a minimum investment required just to get in on the action. Generally, that minimum is $5,000. In fact, municipal bonds are typically sold in $5,000 increments -- a fact that makes them less accessible than corporate bonds and stocks.

Another way to invest in municipal bonds is to buy shares of a mutual fund that focuses on municipal bond investing. When you go this route, you're basically buying a share in many different muni bonds, as opposed to individual bonds. The benefit is that you get instant diversification in your municipal bond portfolio, which can help you avoid losses. Think about it: If you load up on $10,000 worth of bonds from a single city, and that city defaults, you stand to lose a lot of money. But if that city's bonds represent a small fraction of your total muni bond holdings, you won't take nearly as hard a hit. The downside, however, is that you're subject to potentially high mutual fund fees.

If you don't want to buy shares of a municipal bond mutual fund, you can instead buy shares of a municipal bond ETF, or exchange-traded fund. A muni bond ETF, much like its mutual fund counterpart, is a collection of muni bonds that you can invest in all at once. However, ETFs generally have lower operating expenses and greater tax efficiency than mutual funds, which means they often charge substantially lower fees.

Benefits of municipal bonds

Perhaps the most compelling reason to buy municipal bonds is the ability to collect tax-free interest. As stated above, municipal bond interest is always tax-exempt at the federal level, and in some cases, it's exempt from state and local taxes as well. This means that if you buy munis issued by your home state that pay $500 in interest every six months, then the full $500 is yours to keep.

Keep in mind, however, that the tax benefits of municipal bonds only apply to their interest payments -- not capital gains on their face value. Imagine you buy muni bonds for $15,000 and later sell them for $16,000. In that case, you're still liable for capital gains taxes on that $1,000 profit.

Furthermore, while the tax benefits of municipal bonds make them a good choice for a traditional brokerage account, you probably don't want too many munis in your 401(k) or IRA. The reason? These accounts already offer tax-deferred growth, or tax-free growth in the case of a Roth-style account. Therefore you're essentially "wasting" the benefit of tax-free interest by keeping muni bonds in an already tax-advantaged retirement account.

Another benefit of buying municipal bonds is that their historic default rate is extremely low, making them a relatively secure investment. Between 1970 and 2015, there were only 99 defaults on record among the many thousands of munis issued -- and only nine general obligation bond defaults. Further, not a single municipal bond with the highest possible credit rating experienced a default over those four-and-a-half decades. For context, based on historical data, municipal bonds are 50 to 100 times less likely to default than corporate bonds that carry the same credit ratings.

Another advantage to buying municipal bonds is that in doing so, you get the chance to improve a community (either your own or somebody else's). When you invest in corporate bonds, you give a major company a chance to make more money. But if you buy municipal bonds designed to improve a school system, you get a chance to give children access to better resources, all the while making money yourself.

To take this one step further, you might help to improve your own quality of life by investing in municipal bonds. Imagine you buy revenue bonds that are used to build a new highway in your area. Not only do you stand to make money from those bonds, but you stand to reduce your commuting time once that new road is in place. Talk about a win-win.

Drawbacks of municipal bonds

Clearly, there are plenty of good reasons to include municipal bonds in your portfolio. That said, there are some drawbacks to consider as well.

First, municipal bonds tend to offer lower interest rates than corporate bonds, and over time, that can limit your portfolio's growth. That said, the tax benefits of muni bonds are sometimes enough to outweigh that drawback, which we'll discuss in more detail shortly. Also, bonds in general tend to offer a lower return on investment than stocks, which is something to keep in the back of your mind.

Furthermore, as is the case with bonds in general, muni bonds carry what's known as "interest rate risk." As we learned earlier, collecting interest is one of the ways you can make money from bonds. But what happens if you buy a 10-year bond paying 2% interest and several months later see that the same issuer is offering 3% interest on the same type of bond? Suddenly, the value of your bonds will drop, because the same munis are available at a more competitive rate. At the same time, if you continue holding those bonds, you'll lose out on potential growth due to your lower interest rate.

There's also the fact that locking your money away for an extended period of time can sometimes come back to bite you. The whole premise of buying bonds is agreeing to stay invested for a certain period of time before getting your principal back. But what happens if you buy a 10-year bond and then, two years later, find you need your money back? And what if a more lucrative investment opportunity comes your way after just a year or two? At that point, you'll have to hope that the value of your bonds hasn't declined so you can sell them, and if it has declined, you stand to lose money by unloading those munis.

Additionally, though bonds in general are considered safer than stocks, and municipal bonds are considered even safer than corporate bonds, they are by no means risk-free. In fact, in recent years, several governments have defaulted on their municipal bonds, including Detroit back in 2013 and, more recently, Puerto Rico.

What causes municipalities to default? There are a number of factors that could lead to a scenario in which a municipality can't make its interest payments under an existing bond agreement. If a project with a revenue source is poorly managed and winds up costing more and taking longer to complete than expected, then the issuer might fall behind financially and struggle to make payments. Similarly, if revenue comes in much lower than expected, bondholders could end up losing out.

On the other hand, not only are defaults rare among muni bonds, but their associated recoveries -- meaning, the extent to which investors are made whole following a default -- tend to be pretty strong. In fact, the recovery rate for defaulted general obligation bonds is close to 100% (though as of this writing, Puerto Rico is still in the process of restructuring its bonds, and depending on how that plays out, that rate could shrink.

One way to protect yourself against bond defaults (in addition to researching issuers and making sure they have high credit ratings) is to seek out insured bonds. Though not all municipal bonds carry insurance, those that do offer investors added protection, as the insurance companies backing the bonds are required to make payments when issuers themselves cannot.

Finally, as mentioned above, municipal bonds can be hard to come by, as there's generally a minimum buy-in to purchase them directly. And because they don't trade publicly, brokers can get away with charging markups -- markups you may not even realize you're paying.

Choosing the right municipal bonds

Once you decide that municipal bonds belong in your portfolio, you'll need to figure out which bonds to buy. Your first step should generally involve seeing whether there are any viable options issued by your home state, as this will allow you to enjoy the maximum tax benefit of triple-exempt interest (meaning your interest is exempt from federal, state, and local taxes).

From there, you may as well seek out projects that interest you. Remember, one benefit of buying munis is the opportunity to invest in a meaningful way, so it pays to put your money into something you find important. If you care about seeing your town's sewer system improve, for example, you might purchase bonds whose purpose is to fund an upgrade. If you want to see enhancements to your school district, or another school district, you might choose munis earmarked for school improvements.

Once you narrow down your muni bond investment choices, you'll need to vet the issuer in question, and that involves researching its bond rating. There are three major ratings agencies that rank issuers based on their likelihood of meeting their financial obligations versus defaulting on them:

Standard & Poor's (S&P)

Moody's

Fitch

S&P and Fitch use a similar ratings system in which bond issuers are rated from safest to riskiest as follows:

AAA

AA

A

BBB

BB

B

CCC

CC

C

D (refers to bonds that are already in default)

The Moody's rating system is slightly different:

Aaa

Aa

A

Baa

Ba

B

Caa

Ca

C

From there, numbers or symbols are used to further elaborate on an issuer's likelihood to pay. S&P and Fitch use pluses and minuses to denote better or worse creditworthiness, meaning a rating of A+ is better than a rating of A-. Moody's uses numbers to convey relative creditworthiness, with Aa1 being its best rating within the Aa category, followed by Aa2 and Aa3.

Generally speaking, the higher an issuer's bond rating, the lower an interest rate you'll get as an investor. By contrast, bonds with a lower rating generally need to offer higher interest rates to offset their associated risk. As an investor, you need to weigh your desire to snag a higher interest rate against the risk of losing money in the event of a default.

Keep in mind that bonds rated below BBB- by S&P and Fitch and below Baa3 by Moody's are considered junk bonds. You'll often hear junk bonds referred to as high-yield bonds, which might seem like a positive thing when you first read it. But the reason for those high yields is that they carry a high degree of risk. In fact, junk bonds are not considered "investment grade," which means regular investors are generally advised to stay away from them. If you're the risk-happy type, however, and you do your research, you might find a place for them in your portfolio.

Another thing to remember is that bond ratings can change over time. Just because an issuer starts out with a strong rating doesn't mean it can't get downgraded as its financial circumstances change, so always keep tabs on your municipal bond issuers. If you own bonds issued by a city whose rating consistently falls over time, it's a sign that that issuer could end up defaulting. If that's the case, it might pay to sell off your bonds before that happens.

Municipal bonds versus corporate bonds

Municipal bonds differ from corporate bonds not just in the tax treatment of their interest payments, but also in their profit potential. As noted earlier, corporate bonds tend to offer higher interest rates than municipal bonds. Those higher interest rates, however, are subject to taxes that can eat into your earnings.

Imagine you invest in $10,000 of corporate bonds paying 3% interest annually. On a pre-tax basis, you're looking at $300 a year in interest. However, if you fall into the 25% tax bracket, you can expect to fork over $75 of that $300 to your friends at the IRS.

Now imagine you buy $10,000 in municipal bonds paying 2.5% interest. Though the rate you're getting is lower than the 3% offered by the corporate bonds in our example, you get to keep the entire $250 a year in interest you're entitled to. As such, you'd actually come out ahead financially in this example by opting for muni bonds over corporate bonds, all other things (like bond term and rating) being equal.

When you're unsure whether it makes more financial sense to buy muni bonds with a lower interest rate or corporate bonds with a higher one, it pays to calculate the bonds' tax-equivalent yield. To figure out the tax-equivalent yield, you can use the following formula:

Tax-equivalent yield = tax-exempt yield / (1 - marginal tax rate)

Say you're looking at a tax-free municipal bond with a 3% yield, and your marginal tax bracket is 25%. (Your marginal tax bracket is the rate at which your highest dollars of income are taxed.) Your tax-equivalent yield for a corporate bond would be 4%, which means that paying taxes on that bond's interest would be the same thing as getting 3% interest tax-free.

3% / (1 - 0.25) = 4%

If you're not into running numbers till your head spins, you can use this online calculator to determine your tax-equivalent yield. Keep in mind that this formula is best applied when comparing bonds with equal ratings and terms (meaning a bond that asks you to lock up your money for 20 years should generally reward you with more interest than a bond with a 10-year term).

The bottom line on municipal bonds

Municipal bonds let you invest in projects that build and better communities. They also offer an opportunity to secure a steady stream of interest income without exposing yourself to undue risk. That said, they aren't for everyone, so it pays to weigh their advantages against their drawbacks to see if they belong in your portfolio. If you do decide to invest in munis, be sure to research your bonds thoroughly, in terms of both your issuer's credit rating and the price you're being quoted for your bonds. The more educated a decision you make, the more likely your investments are to pay off the way you want them to.

Author

Maurie Backman is a personal finance writer who's passionate about educating others. Her goal is to make financial topics interesting (because they often aren't) and believes that a healthy dose of sarcasm never hurt anyone. In her somewhat limited spare time, she enjoys playing in nature, watching hockey, and curling up with a good book.