Recent research from Hartford Funds suggests the seemingly mundane strategy of investing in dividend stocks could lead to substantial gains. Specifically, going back to 1960, approximately 85% of the S&P 500's impressive 51,000% surge is owed to reinvesting dividends and compounding.

With that in mind, let's examine a couple of longtime dividend-paying stocks that might be worth buying even at or near 52-week highs.

1. Caterpillar

Caterpillar (CAT -0.25%) stock has been on a tear over the past year, generating a total return of 62% for shareholders. The world's largest construction equipment manufacturer has paid a quarterly dividend for 91 consecutive years and raised it in each of the last 30 years. Today, the company pays a quarterly dividend of $1.30 per share, representing an annual yield of 1.45%.

In addition to its dividend, Caterpillar is shareholder-friendly in another way: share repurchases. Management has lowered its outstanding share count by 11% over the past five years, allocating $5 billion in 2023 alone. By focusing on reducing its share count, Caterpillar continually boosts the ownership stake for existing shareholders.

Digging into its financials, Caterpillar produced record-high top and bottom lines despite elevated interest rates in 2023. Specifically, Caterpillar generated $67.1 billion in revenue and earnings per share (EPS) of $20.12, up 13% and 59%, respectively, compared to 2022.

CAT Revenue (Annual) Chart

CAT Revenue (Annual) data by YCharts

While Caterpillar's business has been relatively unscathed by elevated interest rates, there are some signs of weakness. The manufacturer's order backlogs dipped nearly $3 billion from $30.4 billion in Q4 2022 to $27.5 billion in Q4 2023. Management recently noted that China, which has historically produced 5% to 10% of enterprise sales, saw a decline in 2022 and 2023, with continued weakness expected in 2024.

Despite the unfavorable economic conditions, Caterpillar stands to benefit from the largely untapped $1 trillion of federal spending from the 2021 Infrastructure Investment and Jobs Act. For 2024, management expects sales to be similar to its record-setting 2023.

Finally, for any dividend stock, it's important to look at its payout ratio (annual dividends divided by annual earnings) to determine if a company can grow its payments over the long term. Historically, any stock with a payout ratio at or above 75% could challenge a company's dividend growth in the event of an earnings decline. For Caterpillar, which currently has a relatively low payout ratio of 25%, investors should feel confident in its ability to sustain and continue growth with its dividend payouts.

2. Costco

Costco Wholesale (COST -1.49%) is another bellwether stock that has handsomely rewarded shareholders over the past year, producing a total return of 48%. Prospective investors missed out on the recent special cash dividend of $15 per share. Still, the membership-only wholesaler, with a payout ratio of approximately 30%, also pays a regular quarterly dividend of $1.16 per share, equating to an annual yield of 0.65%.

Additionally, based on history and its immaculate balance sheet, there will likely be many special dividends to come. That's because the most recent special cash dividend was the fifth in the last 11 years, and the company still has $3.4 billion in net cash even after paying out an estimated $6.7 billion to shareholders.

Similar to Caterpillar, Costco is setting records as price-conscious shoppers flock to the low-margin retailer. As of Costco's fiscal Q2 2024, the company had 73.4 million paid household members, up 7.8% compared to its fiscal Q2 2023. That translated to $2.2 billion in highly profitable membership fees for the first half of the company's fiscal year, up 8.2% year over year.

Looking at its top and bottom lines, Costco generated $248.8 billion in revenue and $6.8 billion in net income over the trailing 12 months, up 13.2% and 5.7% year over year, respectively.

Long-term, Costco has two growth levers: international expansion and raising membership fees. First, the company only had 874 locations at the end of fiscal Q2 2024, 750 of which were in North America. Unlike Caterpillar, which struggled with growth, Costco has an opportunity in China to expand its membership base significantly. Since opening its first warehouse in 2019, Costco has seen impressive growth, with its membership growing from 10,000 to nearly 200,000 by the most recent quarter, despite having only six locations in the region. Management anticipates opening 28 net new locations globally in its fiscal 2024 compared to 23 in 2023.

Next, Costco has historically raised its membership fees roughly every five years, with the last raise coming in 2017. With a base of 73.4 million members, generating approximately $4.7 billion in high-margin revenue, even a $5 increase across all membership levels could generate an additional $360 million annually. When asked about raising membership prices during the company's latest earnings call, Costco CFO Richard Galanti quipped, "It's when, not if."

Costco's biggest flaw is not its business model or financials, but its valuation. The late Charlie Munger, who was a Costco board member, once said, "The trouble with Costco is its 40 times earnings, but except for that, it's a perfect damn company." Today, the stock trades at 46 times earnings, higher than its five-year average of 39. Nonetheless, in February 2022, when Costco traded at 44 times earnings, Munger said he would buy Costco at its current price. Since that declaration, the stock has generated a total return of 44% for shareholders.

Are these top dividend stocks worth buying?

Any time a stock has skyrocketed over one calendar year, it's healthy for investors to be skeptical of further price appreciation over the short term. Moreover, these are two large-cap companies with long histories as public companies, meaning sudden surges in price are atypical.

Nonetheless, Caterpillar and Costco have positioned themselves as leaders in their respective industries and can capitalize in good and bad markets. That makes these two blue-chip stocks worth buying today for long-term investors, even if they trade near all-time highs.