Jack Ma is ahead of Jeff Bezos in one area: grocery stores.

For years, it looked to some as if Mr. Ma's Alibaba Group Holding Ltd. was simply following in the footsteps of Mr. Bezos's Amazon.com Inc., the world's largest e-commerce company. China's online-shopping giant started as a cloud-computing business and created original entertainment content. But when Amazon's $13.7-billion (U.S.) bid for Whole Foods Market Inc. sent shock waves across the retail industry, Mr. Ma looked prescient.

Alibaba had been quietly incubating its Hema grocery store concept for two years. It rolled out three new locations last month, bringing the total to 13, the bulk of which are located in Shanghai and Beijing. The sprawling, bright supermarkets combine online and offline shopping, where customers who have downloaded Hema's app scan bar codes on products and pay with their Alipay digital wallet.

Story continues below advertisement

The live seafood section is one of the main attractions for Chinese consumers who prize fresh fish and often insist on choosing it themselves. Shoppers at Hema can pick out their own crab or lobster and have it cooked on the spot to eat in the store, or get it delivered to their home. The stores also double as warehouses for delivery in 30 minutes within a close radius.

In Alibaba's quarterly earnings call on Thursday, executives spent a significant amount of time discussing the company's offline retail strategy.

"This is not a supermarket. This is not a food mall. This is a brand new model," said chief executive Daniel Zhang. "Hema just is an example" of how Alibaba can operate the existing offline business.

Hema's experiment in how people pick, pay and get groceries delivered provides a window into what Mr. Bezos may be envisioning for Amazon's integration with Whole Foods. The deal would give Amazon hundreds of physical stores that could act as warehouses for fast delivery. It's also an opportunity for Amazon to roll out its digital shopping experiments on a much larger stage.

For now, Amazon's bricks-and-mortar grocery ventures are still nascent. It has just one "Amazon Go" convenience store in Seattle – still an experiment – that lets employees pay with smartphones, without having to see a cashier or go to a checkout kiosk. It has also introduced pickup points so shoppers can drive by and retrieve their items shortly after ordering them online.

Hema has moved beyond its incubation stage. In its latest financial results, Alibaba reclassified Hema's revenue from "innovation initiatives and others" to "China commerce retail" revenue. For Alibaba, Hema is just the tip of the iceberg. Mr. Ma is trying to upend the $4.5-trillion Chinese retail landscape, as he foresees "tremendous challenges" for online-only commerce companies amid China's slowing economy.

Amazon, too, saw a threat to its online-only model, as retail giants such as Wal-Mart Stores Inc. started encroaching on its turf. Mr. Bezos was forced to expand into physical retail, and not just groceries: He's also opening bricks-and-mortar bookstores, which the company uses in turn to highlight its gadgets.

Story continues below advertisement

In January, Alibaba led a $2.6-billion deal to take private Intime Retail Group Co., which operated and managed 29 department stores and 17 shopping malls across the country. It's also working with partly owned electronics retailer Suning Commerce Group Co.

If Alibaba seems to be out in front for now, part of that has to do with the makeup of retail in China: Competition is tougher online than off. Alibaba's scale online dwarfs any of its physical competitors, according to James Cordwell, an analyst at Atlantic Equities. While Amazon is big, it has only about a third of Wal-Mart's total revenue.

Still, "I'm guessing Amazon is aware of what Alibaba is doing," Mr. Cordwell said. "There will be some degree of copying going on between the two."

Both Alibaba and Amazon are seeking to leverage the data they have on millions of consumers to make shopping easier. In the Hema app, purchases and preferences are saved and consumers can see a personalized product page. Amazon will likely use its Prime membership to send personalized recommendations and digital coupons to consumers.

"As much as U.S. consumers are engaged with mobile devices, it's still ahead in China at this point," said RJ Hottovy, an analyst at Morningstar Inc. "That gives them a leg up in the offline-online strategy when you see the level of engagement in mobile devices."