Investing in AT&T (T 0.38%) over the past two decades has delivered mixed results for long-term investors. Let's break down what a $10,000 investment in AT&T would look like today, starting in June 2004.

20-year results

AT&T's stock price has not shown significant appreciation over the past 20 years. Your hypothetical $10,000 investment would be worth $9,752 today. That's a negative return, leaving you with less money than you originally invested. At the same time, the SPDR S&P 500 ETF Trust (SPY 0.12%) turned the same $10,000 bet into $48,180.

SPY Chart

SPY data by YCharts.

But what if you also reinvested dividends in buying more shares along the way? Dividend reinvestment plans (DRIPs) can be game-changing tools in the long run, especially for generous dividend payers like AT&T.

On that note, AT&T's total return almost caught up with the S&P 500 index tracker fund over the last 20 years:

SPY Total Return Level Chart

SPY Total Return Level data by YCharts.

Alright, I stretched the truth a bit there. AT&T's dividend-powered total return nearly matched the dividend-free price gains of the S&P 500 in this period.

Not even the dividend boost made AT&T a winner

The key takeaway here is the undeniable power of dividends in long-term investing. While AT&T's stock price performance was disappointing, the reinvested dividends significantly bolstered the overall return.

It's worth noting that this period was arguably a golden age for AT&T, with the rise of ubiquitous cellphones, then smartphones, and successive waves of 3G, 4G, and 5G upgrades. Despite these tailwinds, AT&T's dividend-boosted returns couldn't match the broader market's dividend-less gains. Ma Bell doesn't impress me from a long-term perspective.

You may very well be better off with a simple S&P 500 index fund than this disappointing telecom giant.