Both Costco Wholesale (COST -0.55%) and BJ's Wholesale Club (BJ -3.60%) stocks are beating the market in 2022, and it isn't hard to see why. Consumers are focused on saving money, and an inflationary environment tends to make the warehouse retailers' value propositions more obvious.

These companies seem ideally positioned to ride out a potential recession, and earnings growth might be especially strong if the economy avoids that scenario. But which one is the better buy heading into 2023? 

Stability vs. potential

Both companies are growing at an impressive pace today, with comparable-store sales rising in the mid-single digits on top of booming sales gains a year ago. Their consumer staples focus has allowed Costco and BJ's to avoid the type of challenges that hurt less-diversified retailers like Target and Home Depot. In contrast to these businesses, the wholesale clubs are seeing increased customer traffic and higher average spending.

But BJ's has a slight advantage on the growth front because of its smaller sales footprint. Strong customer traffic trends over the last few years imply the chain can expand out of its current regional focus to reach more metropolitan areas.

On the other hand, Costco's maturity and massive scale provide stability, which might be valuable if a recession develops in major markets like the U.S. in 2023. But Costco already has established itself in most major metro areas, so its expansion options are more limited.

Earnings outlook

Both companies rely almost exclusively on membership fees to power profits, which gives Costco and BJ's another advantage over other retailer peers. Earnings won't collapse during slower consumer spending times, since they aren't tied to merchandise markups.

Yet Costco has the brighter outlook here. The company is just about due for an increase to its annual membership fees after several years of those charges holding steady. Subscribers are clearly getting tons of value from their memberships, too.

Costco just reported that its renewal rate ticked up in late 2022 beyond to roughly 92%. That means there is room for the chain to increase its fees in 2023, immediately boosting its earnings.

The better value?

Costco is valued at a large premium compared to BJ's, which reflects a few of its unique competitive assets, like its huge global base of paying members. You can own BJ's shares for 0.5 times annual sales, compared to 0.9 times sales for Costco.

In my view, that premium shouldn't scare you away from this stellar stock. While Costco isn't immune to recessions, its sales and earnings should hold up far better than most of its industry peers. Combine that factor with its ability to increase annual fees over time, and you've got all the ingredients you need for market-thumping returns.

Sure, BJ's Wholesale Club could notch faster growth over the next few years as it opens warehouses in new geographies. But Costco's shares, which became cheaper through 2022, seem more attractive for holding through a wide range of potential selling environments that investors could see over the next several years. Both companies are winners right now, but the industry leader seems like the less-risky choice.