The taxman will have his due, but there's no reason you should give him more than you have to. Source: Flickr user kev-shine.

Paying taxes can put a major dent into your investment returns, especially if you don't plan ahead to minimize your tax bill. But there are ways to invest without paying any federal taxes. Here I'll take a look at three tax avoidance strategies that are not only legal but even encouraged by the government.

Individual retirement accounts
An individual retirement account is a retirement savings vehicle that comes with considerable tax benefits. There are two main types of IRA: the traditional and the Roth. While a traditional IRA gives you a tax deduction up front, contributions to Roth IRAs are not tax-deductible. But when the time comes to start drawing the account down, traditional IRA holders have to pay tax on their withdrawals, while Roth IRA holders can withdraw their funds tax-free.

With a traditional IRA, you will be required to take minimum distributions upon reaching age 70-1/2, at which point those distributions will be taxed at ordinary income tax rates; after all, if you get a deduction up front, you have to pay taxes eventually. By contrast, a Roth IRA does not require minimum distributions, and any withdrawals made are tax-free. This effectively allows those using Roth IRAs to avoid taxes on gains made in the account, while traditional IRA holders only delay their taxes until a distribution is taken.

But is a traditional IRA or a Roth IRA better for you? If you expect to be in a higher tax bracket when you retire, then you should consider a Roth IRA. You can pay lower taxes now and avoid the higher taxes you would have to pay on your withdrawals from a traditional IRA. Even people in high income brackets should consider Roth IRAs. If you expect income taxes to be higher in the future, it may be worth paying taxes up front to protect yourself from higher taxes later.

On the other hand, if you need the tax deduction now or you think your tax rate will be lower in the future, a traditional IRA may be a better option.

Municipal bonds
Ordinarily, interest income is taxed at ordinary income tax rates, but income from certain municipal bonds is tax-exempt at the federal level for most holders. For people in higher income tax brackets, this can mean major tax savings, provided you do your research.

First of all, you need to make sure the municipal bond is tax-exempt. Most of the time this information can be easily found online. If you're unsure, contact your broker or financial advisor to make sure you understand the features of the bond. Once you've found out whether a municipal bond is tax-exempt, you may need to see whether it's subject to alternative minimum tax. Your broker should also be able to provide this information. When it comes to determining whether or not you will owe AMT, you should look over previous tax returns and consult with a tax professional.

Next, you can calculate the tax-equivalent yield. When comparing tax-exempt bonds with taxable bonds, it's important to compare tax-equivalent yields to fairly compare how much you'll get to keep after taxes. This can be calculated by dividing the municipal bond's yield by one minus your tax rate.

tax-equivalent yield = bond yield / (1 - your tax rate)

For example, a tax-exempt bond yielding 5% would have a tax-equivalent yield of 6.7% for someone in the 25% tax bracket. If this person were to invest $10,000 into bonds, the 5% tax-exempt bonds would produce considerably more after-tax income than 5% taxable bonds. In the case of the tax-exempt bond, the investor would get $500 per year in tax-free interest, while the taxable bond would only leave $375 per year after taxes.

It can be difficult for ordinary investors to diversify themselves across several municipal bonds due to the minimum purchase requirement. For these investors, municipal bond ETFs may be the answer.

Municipal bond ETFs are often based on risk levels, with higher-risk bonds offering higher yields. For lower risks and lower yields, the SPDR Nuveen Barclays Municipal Bond ETF (NYSEMKT:TFI) yields about 2.4%. Those with a higher risk tolerance may want to consider the Market Vectors High Yield Municipal Index ETF (NYSEMKT:HYD), yielding around 5%.

Both ETFs focus on tax-exempt bonds, although some may be subject to alternative minimum tax, allowing investors to invest in tax-exempt bonds while remaining diversified.

0% capital gains rates
Subject to a few exclusions, individuals in the 10% and 15% income tax brackets can take advantage of a 0% tax rate on long-term capital gains and qualified dividends. Those in the top tax bracket (39.6%) will be taxed 20% on these gains and may incur a 3.8% net investment income tax if they are above certain income levels. Taxpayers in the other brackets have a 15% rate.

Long-term capital gains are gains on investments that have been held for longer than a year. If you sell an investment for a profit within a year of buying it, then your gain is considered short-term and will be taxed at your ordinary income tax rate.

For a dividend to be considered a qualified dividend, the IRS has minimum holding rules. The IRS has defined a period of 121 days, consisting of 60 days on each side of the ex-dividend date, to evaluate dividends. For a dividend to be considered a qualified dividend, and thus subject to lower tax rates, it must be held for more than 60 days during this 121-day period.

Dividends from certain entities such as real estate investment trusts and business development companies are not considered qualified dividends because those entities themselves are tax-exempt and are required to pay out almost all their earnings to shareholders.

If you're in the 10% or 15% tax bracket and have some money to invest, it's worthwhile to take advantage of the tax-free treatment of long-term capital gains and qualified dividends. Those in higher brackets can still receive favorable tax treatment, although they will not qualify for the 0% rate.

The bottom line
Proper tax planning is essential to make sure you get the most you can from your investments. Those in the 10% and 15% income tax brackets can take advantage of 0% rates on certain gains, while nearly everyone can use Roth IRAs and municipal bonds to their advantage.

Investors looking to reduce their tax bill should see whether these three legal tax-avoidance strategies can help them keep more of their gains.