In investing, there are three basic types of accounts in which you can buy stocks: tax-free, tax-deferred, and taxable. Tax-free accounts mainly include Roth IRAs. Traditional IRAs, 401(k)s, and some other types of accounts are tax-deferred, meaning that you can deduct contributions and are not taxed on dividends every year, but rather on distributions. Finally, most investment accounts that allow you to deposit as much as you'd like and withdraw whenever you want are taxable. 

While both types of retirement accounts have their own tax advantages, Roth IRAs are without a doubt the best choice for dividend investing. Let's take a look at the difference tax-free investing could make for your investment returns over time.

Don't waste room in your tax-free account!
While it can be lucrative to hold growth companies and other stocks that pay very little in the way of dividends, it can be a waste of your tax advantages in your Roth IRA. Sure, you'll get out of paying capital-gains tax when you sell, but the real advantage of tax-free investing is allowing your dividends to compound without being taxed.

Source: Flickr user 401(k) 2012.

Let's say that you invest $10,000 in a growth company that appreciates in value by 15% per year, on average over a 30-year period, and that you buy shares in a normal (taxable) brokerage account. This would result in an ending value of just over $662,000, and your only tax liability would be to pay capital gains tax when you sell, which is currently 15% for most tax brackets. In other words, you would walk away with about $563,000 after paying taxes on your gains.

Whatever you do, don't pay taxes on your high-yielders and bonds!
The space in your Roth IRA is limited because of the maximum allowable contribution of $5,500 per year. So your high-dividend investments should get first priority because of the powerful effects of tax-free dividend compounding.

For instance, let's say you invest in a high-dividend stock such as a mortgage REIT or a business development company. For comparison's sake, let's say that the stock returns the same 15% annually as our growth example, except that 10% is in the form of dividends and 5% is share price appreciation.

Here's where the tax treatment really makes a difference. If you were to buy a high-dividend stock like this in a traditional account, not only would you be liable for any capital gains when you sell, but you would also be required to pay taxes on the dividends you receive each year. Assuming your dividends are taxed at 15% (it could be more depending on the tax treatment of the particular company), this would leave you with an ending value of just under $447,000 after 30 years -- and this is before you sell and have to pay taxes on the share price appreciation. After paying capital gains tax, you could be left with less than $380,000!

Taxable vs. Non-Taxable Investment Performance | Create Infographics

So buying our high-dividend investment in a taxable account cost us more than 32% of the gains we would have been entitled to keep if we held our shares in a Roth IRA. Holding a growth stock in a traditional account costs nothing in taxes until you sell. I'd say that a $215,000 difference in your portfolio is worth spending some time on getting the allocation of your stocks right!

Prioritize accordingly!
A good exercise here would be to make a list of all of the investments in your portfolio in order from highest to lowest dividend yield. Those stocks with the highest yields should absolutely have highest priority for space in your Roth IRA. If necessary, it might be a good idea to make some adjustments. It may cost you a few bucks in commissions to reallocate your stocks between accounts, but it will pay off in the long run to have your dividend stocks in the right place.