Without the benefit of a crystal ball, no one knows what the future holds. But carefully analyzing a company's long-term prospects can increase your odds of investing success. Costco Wholesale (COST 1.01%) and Dollar General (DG -0.41%) have been successful retailers for a long time. They appear to be on divergent paths, however. So which stock offers the better long-term return potential?

Two people studying papers.

Image source: Getty Images.

Costco

Costco has become known for its huge warehouses that sell every imaginable good and service. You have to pay an annual membership, but members get to buy high-quality wares at low unit prices.

And members clearly find the price of admission worthwhile. Costco's renewal rate has hovered around 90%, and it was 90.4% in the latest fiscal year that ended on Sept. 3. Meanwhile, it continually attracts new paid members, which totaled 71 million compared to 65.8 million last year.

It's a simple business that management executes very well. Its latest quarter's operating income was $2.8 billion, up 11.4% from a year ago. Faced with higher costs, particularly for wages, Costco's margin was up only slightly.

Management, which typically raises membership fees every few years, last implemented an increase more than six years ago. It stated that it's only a matter of time before the next price hike. Based on strong customer loyalty and the long lag between fee hikes, members don't seem likely to balk.

This will help boost Costco's margin. Expansion opportunities remain, too. Costco finished the year with 861 warehouses, up from 838 a year ago. Management plans to open 28 more this year.

Dollar General

Dollar General traces its roots back over 80 years, and opened its first namesake store in 1955. Offering most items for under $10, it's had tremendous success, posting 31 straight years of positive same-store sales (comps) from 1990 to 2020.

But things have been rocky lately. In the company's fiscal second quarter, which ended on Aug. 4, comps fell by 0.1% and earnings per share dropped by over 28.5% to $2.13. Management also lowered its fiscal 2023 guidance. It now expects a -1% to 1% comps change and an earnings per share decline of 22% to 34%.

Consumables, which encompass everyday items like paper towels, cleaning products, trash bags, and food, account for about 80% of sales. While these items had positive sales, other higher-margin categories were negative.

It's difficult to blame the overall environment when other discount retailers have done well. For instance, while Dollar General has struggled, behemoth Walmart has thrived. In the fiscal quarter that ended on July 31, comps at its U.S. stores rose by 6.4%.

The winner

Costco's stock, with a price-to-earnings ratio (P/E) of 40 versus 25 for the S&P 500, doesn't appear inexpensive. Meanwhile, Dollar General's stock sells at a P/E of 11. However, as Warren Buffett once said, "It's far better to buy a wonderful company at a fair price than a fair company at a wonderful price." As Costco continues to retain members and add new ones, driving profitability growth, I would put Costco in the former category.

That makes Costco the clear winner.