The growth of the e-commerce sector is providing a nice environment in which exciting new players can thrive, and Shopify (NYSE:SHOP) has not disappointed its shareholders. Last year alone, Shopify's stock grew by a whopping 187%, easily outpacing the S&P 500's 29% return during the year.

Elsewhere, Square (NYSE:SQ) is profiting from another fast-growing segment of the economy, namely the market for digital payments. However, Square hasn't performed nearly as well as Shopify lately. Last year, Square's shares were up by a meager 11.5%.

Looking forward, though, both of these growth stocks have tremendous opportunities ahead of them, and both could reward investors by way of market-beating returns for many years to come. But which one is the better buy today?

A chess player knocks a black rook over with his white rook.

Image source: Getty Images.

The case for Shopify

Shopify isn't just an e-commerce platform; the company is looking to become a one-stop-shop for small and medium-sized businesses looking to create an online store. That's why, in addition to giving merchants a highly customizable platform to build their own stores from scratch, Shopify offers thousands of apps through its app store.

So far, Shopify's strategy has been highly successful. The company now boasts over 1 million merchants, and during the third quarter, Shopify's gross merchandise volume (GMV) -- the total value of items sold through its platform -- was $14.8 billion, a 48% increase year over year. Further, Shopify's revenue was $390.6 million, 45% higher than the prior-year quarter. Detractors may point out that Shopify is still unprofitable; fair enough. However, the company is investing heavily in several growth opportunities.

For instance, Shopify is building a fulfillment network to help merchants on its platform deliver their customers' orders in a faster and more cost-effective way. To this end, Shopify acquired a privately held provider of warehouse fulfillment solutions called 6 River Systems for $450 million (in a mix of cash and stock).

This initiative could attract even more merchants to the platform, and Shopify has already "received an incredible amount of interest" from its customers about its fulfillment network, according to CFO Amy Shapero. On the company's second-quarter earnings call last year, she said: "Thousands of merchants have expressed their desire to be a part of our early access program, and dozens of partners are eager to join us in being a part of the solution." 

Lastly, Shopify is looking to grow its presence in international markets. During the company's third-quarter earnings conference call, Shopify's COO, Harley Finkelstein, said: "Our international expansion efforts continue to pay off as merchants from outside our core geographies were once again the largest component of new adds." This massive opportunity abroad could help Shopify continue on its dazzling upward trajectory. 

The case for Square

Square made its name by providing innovative alternative payment processing methods to businesses. For instance, the company's credit-card readers come in different sizes and can turn electronic devices -- particularly tablets and cellphones -- into point-of-sale systems. The versatility its products offer helped Square become popular among small and medium-sized businesses.

Square continues to post strong financial results, too. During the third quarter, the company's GMV was $28.8 billion, a 25% increase compared to the year-ago period, and Square recorded a total net revenue figure of $1.27 billion, representing growth of 44% year over year. Also, the company's net income was $29 million, 45% higher than the year-ago period. Square has several growth opportunities. In particular, its person-to-person (P2P) payment app, Cash App, has been making some serious headway. During the third quarter, Cash App's revenue was $159 million (excluding Bitcoin), up 115% year over year. 

Square is looking to transform Cash App into a proxy for a bank account, and the company offers such services as prepaid debit cards and direct deposits for its customers, as well as lending, payroll, and inventory services for businesses. Square even announced it would start offering commission-free stock trading on its Cash App. Square's P2P app will continue to be a major growth driver in the future. As company CFO Amrita Ahuja said on the third-quarter earnings call

We're continuing to invest aggressively into both our Cash App ecosystem, as well as our Seller ecosystem, and we think we're in the early days there in terms of customer acquisition and in terms of the product roadmap. So we'd expect to continue to see strong and growing contributions from Cash App going forward. 

Finally, Square recently started offering payment processing services to sellers of cannabidiol (CBD)-based products. Although the CBD industry ran into some trouble last year -- as the U.S. Food and Drug Administration (FDA) warned consumers about the potential dangers of CBD-based products -- the CBD market is projected to grow at a fast pace over the next few years. Square's move to enter this market could pay rich dividends down the road, and given the strength of its core operations, as well as the growth of its Cash App, the company's future looks bright. 

The verdict

Despite Shopify's exciting prospects, the company's stock isn't cheap: Shopify's price-to-earnings growth (PEG) ratio is currently 39.44, while its price-to-sales ratio is 35.19. Those valuation metrics make Square and its 2.21 PEG ratio -- as well as its 6.74 price-to-sales ratio -- look like the bargain of the year. 

Both stocks are a buy, in my view, but Square's more attractive valuation metrics lead me to conclude that the company has more upside at the moment, making it the winner in this match-up. 

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.