It seems monstrously unfair that you have to pay taxes on dividends.

After all, that money has already been taxed. A company that pays out dividends pays taxes on its own income and shares the profits in the form of a dividend payout to shareholders.

The unfairness of it, though, doesn't stop Uncle Sam from wanting his cut of your dividend earnings. If you are going to invest in dividends and you want to legally cut your tax bill, you need to know how it works.

Before you invest in dividends, here are a few things to know:

Dividends are a category separate from regular income and capital gains. Dividends are not considered capital gains. As a result, they are not seen as 'long-term' or 'short-term.'

While in recent years the tax rate has been the same for 'qualified' dividends as long-term capital gains, don't get too used to this -- the tax rate on dividends can change regardless of what is happening with the long-term capital gains tax rate.

In the past, dividend earnings have been treated as regular income and taxed at your marginal tax rate. However, dividends aren't exactly considered regular income. They are separate and have, since the implementation of the so-called Bush tax cuts, enjoyed special tax consideration.

Wealthy dividend investors face a tax hike starting in 2013. The special treatment for dividend earnings was to expire at the end of 2012. The fiscal cliff tax deal, though, changed things a little. Dividends retain a favored tax status -- with those in the 10% and 15% brackets still paying 0% on 'qualified' dividend earnings, while others pay 15%.

High earners face a different fate. Those filing singly who earn $400,000 a year and those filing as married who earn $450,000 a year will see a tax rate of 20% on qualified dividends starting in 2013. If you are a high earner and can find a way to keep your income below the threshold, you won't be subject to the higher tax rate.

Here's what the IRS considers a 'qualified' dividend. No dividends enjoy the special tax treatment. Make sure your dividend earnings are 'qualified.' Here are the exact words the IRS uses to define what 'qualifies' a dividend for the special tax rate:

'[Y]ou must have held the stock for more than 60 days during the 121-day period that begins 60 days before the ex-dividend date.'

And, for preferred stock:

'[Y]ou must have held the stock more than 90 days during the 181-day period that begins 90 days before the ex-dividend date if the dividends are due to periods totaling more than 366 days.'

The ex-dividend date -- as stated in our Financial Dictionary -- is the day on which all shares bought and sold no longer come attached with the right to receive the most recently declared dividend.

The ex-dividend date is normally two business days before the record date. If you purchase a stock on or after its ex-dividend date, you will not receive the next dividend payment. Instead, the seller gets the dividend. If you purchase before the ex-dividend date, you will get the dividend.

Here is an example:

On July 27, 2010, Company XYZ declares a dividend payable on September 10, 2010, to its shareholders. XYZ also announces that shareholders of record on the company's books on or before August 10, 2010, are entitled to the dividend. The stock would then go ex-dividend two business days before the record date.

In short, you need to have held the stock for a while before you can collect a dividend. This prevents investors from purchasing dividend stocks in large quantities prior to the stock going ex-dividend, and reaping the tax benefits of a large dividend windfall.

Reinvested dividends are still taxed. Many dividend investors are surprised to find they owe taxes on their reinvested dividends. It's true that you don't actually get the money into your hands in all cases of reinvested dividends -- especially if you use a DRIP to automatically reinvest your dividends.

However, you still have to pay taxes on it.

Shelter dividend earnings in a tax advantaged account. If you want to shelter your dividend earnings from Uncle Sam, you can do so with the help of a tax-advantaged account. If you hold your dividend stocks in a traditional IRA or a traditional 401(k), you don't pay taxes on your dividend earnings -- including reinvested dividends -- in the year you receive them. Instead, the earnings are tax-deferred.

You pay taxes later, when you withdraw money from your account. The amount you withdraw is taxed at your marginal rate, no matter where the earnings come from. If you think your marginal tax rate will be higher at retirement than the dividend tax rate, there's no reason to keep your dividend stocks in a traditional account.

With a Roth account, though, you don't ever have to worry about taxes on your dividends. You pay taxes before you make your contribution to your account. Dividends (and reinvested dividends) are paid into your Roth account as earnings, and you don't need to worry about paying taxes when you withdraw them.

The same is true of a health savings account (HSA). You can hold dividend stocks in an HSA, and as long as you use the earnings for qualified health care expenses, you never have to pay taxes on your dividend earnings -- and you get a tax deduction for your contributions to boot.

The Investing Answer: Plan to reduce the taxes you pay on dividend earnings so you can grow your wealth at a faster rate. If you qualify, a Roth retirement account or an HSA can be a great way to shelter your dividend earnings.