Costco Wholesale (COST -0.44%) and Starbucks (SBUX 2.09%) have both been great stocks to own over the past few years. The ubiquitous coffeehouse chain is up 105% since April 2016, while the warehouse club operator has soared 147% during the same time. 

That said, the historical success of these large-cap stocks does not necessarily guarantee satisfactory returns going forward. Investors need to weigh the merits of each today to come up with their own conclusions. 

Let's find out which stock is the better buy. 

green keyboard key that says "Buy stock"

Image source: Getty Images.

The case for Costco 

Investor worries about a slowdown for the giant warehouse retailer following a reopening of economies have been overblown. For the month of March, adjusted comparable sales (excluding the impacts from changes in gasoline prices and foreign exchange) rose 11.1%, with e-commerce revenue increasing at an impressive 54.5%. 

Although these March figures showed a slight deceleration from January and February, they clearly demonstrate the strength of Costco's business. For example, in the most recent quarter, the home furnishings, toys, and consumer electronics categories were some of the better performers. 

Compare this to the spring of last year when people stocked up on toilet paper, paper towels, and cleaning supplies. It's obvious that Costco's massive selection of goods can satisfy customer demands at any particular time. 

Costco still sports a very healthy membership renewal rate (91% in the U.S. and Canada in the second quarter of 2021), a positive sign given that essentially all of the company's profits come from membership fees. Furthermore, enticing investors is a dividend that has grown at a compound annual growth rate of 13% per year since 2004. 

While Costco did not open any new locations in the most recent quarter, it did open eight net new stores in the previous quarter. And management has stated that it plans to open 13 stores during the rest of the year. For a company this size (808 stores and $163.2 billion in sales in the last fiscal year), this kind of growth is very encouraging. 

Investors can still ride a solid wave of growth if they purchase shares of Costco today. 

The case for Starbucks 

Starbucks has come roaring back since the depths of the pandemic (in the third quarter of 2020) when global comparable sales dipped 40%. In the most recent quarter (ended Dec. 27, 2020), global comparable sales were down only 5%. What's more, management thinks this figure will expand an impressive 18% to 23% for the full fiscal 2021. 

The coffee retailing behemoth was definitely affected by the pandemic as its customers spent most of 2020 working from home, which resulted in less time commuting to the office and stopping to pick up caffeinated beverages. But by leaning heavily on its digital prowess (and 21.8 million rewards members in the U.S.), the business was still able to serve its customers. Whether it was delivery, curbside pick-up, or the extremely popular drive-thru option, Starbucks found a way to grow the average ticket size as larger group orders became the norm. 

Starbucks' brand is second to none. There are currently nearly 33,000 locations worldwide, but management thinks that in the next decade, this number will hit 55,000. For investors thinking there's no way the business can keep opening new stores, this is some delightful news. 

Most of the growth will come from China, where Starbucks plans to open 600 net new locations this year. Having exposure to one of the largest and fastest-growing economies is a good place for the company to be as the world starts to open back up. 

As far as new locations are concerned, it seems that Starbucks has a much longer runway for growth than Costco does. 

The valuations 

I just spelled out merits for owning both Costco and Starbucks. While Costco received a boost from the pandemic that still has not let up, Starbucks has since showed resiliency and bounced back after being severely impacted at first. So, which one is the better buy? 

Based on one year forward P/E ratios, Costco (33.8) looks just about slightly cheaper than Starbucks (34.1). But quite honestly, I think investors can't go wrong owning either of these fantastic businesses. They both are adored by consumers, have strong competitive advantages, and still have plenty of growth left.