Costco Wholesale (COST 1.01%) and McDonald's (MCD 0.47%) are venerable companies that have proven popular with consumers over many years. They have become dominant through their focus on providing value to customers.

Last year's results took divergent paths, which each stock reflected. Costco's stock price increased by 28%, besting the S&P 500's 16%. Meanwhile, McDonald's shares underperformed the overall index with a more than 8% gain.

But the market typically looks at short-term results. To figure out which is the better long-term stock investment, it is time to dig deeper into each company's prospects.

Two people looking at charts and one is using a calculator.

Image source: Getty Images.

A popular destination

With over 39,000 establishments in more than 100 countries, McDonald's golden arches are perhaps the restaurant industry's most recognizable symbol. However, it doesn't own the majority of restaurants. Rather, it franchises 93% of them, in which the franchisees pay McDonald's an upfront fee plus an ongoing percentage of its sales. It is also a landlord in many instances, so it also receives rent.

Heading into 2020, McDonald's, with its inexpensive food and quick service, was doing well. Its 2019 comps rose by 5.9%, with higher guest counts contributing one percentage point. This was due to changes management implemented, such as all-day breakfast, new menu items, and a focus on the "3 D's" -- digital, delivery, and drive-thru. The company's operating income grew to $9.1 billion, 27% higher than 2015's $7.1 billion.

Last year, with governments imposing social distancing guidelines, was a different story. Still, results showed an improvement in the third quarter as governments relaxed restrictions, and its previous push of the 3 D's proved fortuitous. Comps were down 2.2%, but they did better each month.

While cases are surging, creating some near-term uncertainty as governments and people react to contain the virus, McDonald's long-term prospects look promising with its affordable menu that it is constantly tinkering with to adapt to consumer preferences (including reintroducing the popular McRib for a limited time), and the company continues to push the 3 D's.

The company's dividend track record, raising it for 44 consecutive years since its first payout in 1976, is impressive. This includes boosting December's payment by 3% to $1.29. The stock's dividend yield is 2.4%.

Offering members a good value

Costco is not your typical retailer. It operates warehouses that offer a variety of goods sold in bulk and services at lower prices than members can typically find elsewhere. It charges members to shop there, and they happily sign up and stay on. The number of paid memberships has grown from 47.6 million to 58.1 million over the last five years. It consistently has a nearly a 90% renewal rate worldwide.

With positive same-store sales (comps) for many years and increased profitability, Costco is executing its plan to serve members by offering them high-quality merchandise at low prices. Over the last five years, its operating income grew by nearly 50% to $5.4 billion.

The company got off to a good start in 2021, too. For its first fiscal quarter, which ended on Nov. 22, comps were up by 17.1% after excluding gasoline price changes and foreign currency exchange translations. Costco's operating income increased by 35% to $1.4 billion.

Costco's success is leading management to continue opening new warehouses. Historically, it added 20 to 25 clubs annually. It ended last year with 795 and opened eight in the first quarter, with plans to add 20 to 22 for the year.

The company has also built an impressive track record of raising dividends annually since its initial payment in 2004. Its 0.7% dividend yield pales in comparison to some companies, but it has bright growth prospects. Costco has also paid large, special dividends to shareholders every few years, including a $10 payment last month.

The decision

Choosing between Costco and McDonald's is a tough call. Both are well recognized, popular destinations. For me, Costco comes out ahead due to its ability to draw in members based on its offerings, which have produced consistently improving results.