For investors a decade or two away from retirement, dividends can be a bad deal, because yes, you do pay taxes on them every year.

In this segment from Motley Fool Answers, Alison Southwick and Robert Brokamp consider whether such investors should skip dividend stocks entirely. But as Bro explains, there is a way to hold dividend payers without worrying about the tax bill each year. Tune in to learn more.

A full transcript follows the video.

This podcast was recorded on April 18, 2017.

Southwick: It's time for [Answers, Answers] and today's question comes from Anna from Twitter. She writes: "I'm 10 to 20 years away from retirement. Should I avoid dividend stocks in order to avoid the income tax?"

Brokamp: Well, that's an interesting question, Anna. I would say if you're going to avoid dividend payers, the problem, there, is you're actually going to have to ignore most of the market, because most stocks actually do pay dividends.

Also several studies have shown that as a group, dividend payers outperform non-payers over the long term, although that can change depending on the time frame you look at, like during the '90s. During the boom-boom years, it was actually better to have non-dividend payers. But, of course, that all changed. All those non-dividend payers didn't turn out so well in the 2000s.

But I will give you a real-life example of investing in a dividend payer outside of an IRA, because I just came across this when I did my taxes. So 20 years ago, when I was but a wee little Bro, or at least a ...

Southwick: Aw! Baby Bro!

Brokamp: ... a Bro with less hair. As a poor teacher ...

Southwick: Bro with probably more hair, actually.

Brokamp: Well, maybe more hair is what I meant to say. So as a poor teacher I was about to leave teaching to go to grad school, so I was not investing a whole lot. But I found out that Home Depot had what is called a direct stock purchase plan, or a dividend reinvestment plan. You can send the money directly to the company (so you didn't have to have a brokerage account [and] you didn't need a broker), and the minimum was $500. So this is 1996, 1997. I sent them $500.

Well, because it's not in my brokerage account, I also forget about it until tax time rolls around [and] they tell me how much I owe in taxes based on the dividends they paid me. So this morning I looked [at how much that is] worth now, because I really hadn't been paying attention. So $500 back in like 1996, 1997 today is worth more than $6,000.

Southwick: Oh!

Brokamp: Because the stock price has gone up [and] because I've been reinvesting the dividends to buy more shares and those dividends are growing. I don't have the information from when I first bought it, but I do have the information from the end of the year 2000. Back then, I had 29 shares and each share paid a quarterly dividend at the end of 2000 of $0.04 per share. Now I have over 40 shares and each dividend -- the last quarter's dividend -- was $0.89, so it's gone up from $0.04 to $0.89.

That's all good, but [Anna] brings up a good point, and that is while this has been growing, I have been paying taxes on the dividend ...

Southwick: Even though you've reinvested them, you still have to pay taxes on them.

Brokamp: Exactly.

Southwick: Ach!

Brokamp: That's a very good point. So if you're going to invest in dividend-paying stocks and you are also going to invest in non-payers, ideally keep the dividend payers in your IRA and 401(k). Use your regular, taxable brokerage for the non-payers, but don't not invest in a good stock just because it pays a dividend and you have to have it in a taxable brokerage account.

Alison Southwick has no position in any stocks mentioned. Robert Brokamp, CFP owns shares of Home Depot. The Motley Fool recommends Home Depot. The Motley Fool has a disclosure policy.