If you want to be smart about saving for retirement, you need to know about IRAs. These tax-favored accounts give you the ability to defer taxes on earnings on money you set aside for retirement. Different types of IRAs also give you either an up-front tax deduction when you make initial contributions or tax-free treatment when you withdraw money in retirement.

Because of the tax benefits, it's smart to use IRAs for investments that generate a large amount of taxable income on a regular basis. Dividend stocks are typically good candidates for IRAs, but there's one subset of dividend stocks that I avoid putting in IRAs: foreign dividend-paying companies. The reason: I learned the hard way that many brokers don't treat them correctly, forcing you into a tax mess that can cost you a lot of time and money.

Large spread-out pile of various types of currency from different countries.

Getting dividends from foreign companies can be more taxing than you think. Image source: Getty Images.

Foreign dividend stocks and IRAs

When you invest solely in U.S. stocks, IRAs are simple. Income comes into your account when the stocks that your IRAs hold pay dividends, but you don't have to report that income on your tax return. In a traditional IRA, you'll have to pay tax on that income when you withdraw it in retirement, but until then, it simply mixes in with the other assets you have in your account.

But there's a problem when some foreign dividend payers make payouts that go into your brokerage account. Many foreign countries have agreements with the U.S. government that ensure that they can collect income tax on the dividend income that stocks of companies located in those countries pay to shareholders. The tax shows up as an automatically withheld percentage of the dividend income you receive, and your broker will typically show that withheld amount as a debit against your credited dividend payment. So for instance, if a foreign company pays a dividend of $100 and the country where it's located has a 25% withholding tax rate, then your broker will hang on to $25 and credit $75 to your account.

Theoretically, your brokerage company usually isn't supposed to do the same thing with foreign dividends paid into IRAs. That's because most of the tax treaties between the U.S. and foreign countries recognize and respect the various tax-free investment vehicles that you'll find across the globe. Yet many brokers don't actually follow that guidance, and that can result in your having tax withheld that can be next to impossible to get back.

Why foreign tax withholding and IRAs don't mix

When you invest in a taxable account, it's perfectly appropriate for you to pay foreign tax on your income, and you can generally get made whole. Foreign tax credits let you claim a credit against your U.S. taxes for any foreign taxes you pay on investment income from sources abroad. Calculating the credit is complicated, but in most cases, you'll end up paying either the U.S. tax or the foreign tax on your dividends, whichever's higher, but not both.

For IRAs, however, no foreign tax credit is available even if the account ends up having taxes withheld from income from foreign sources. That leaves you in the uncomfortable situation of having to try to convince your broker to reverse the improper withholding, or trying to collect a tax refund from the foreign government that withheld the tax in the first place. In my experience, trying to get satisfaction in those situations takes a huge amount of time and effort, and often doesn't produce a payoff.

Two solutions

If you want to avoid this situation, then you can do what I do and stop investing in foreign dividend payers in IRAs. However, if you're open to changing your brokerage relationship, another potential solution is to contact your broker to find out whether it handles foreign dividends the correct way, without withholding tax unnecessarily. If your broker says that it knows not to withhold foreign tax from an IRA, then you can safely look at foreign dividend stocks as a good source of income and potential long-term growth.