Better Buy: eBay Inc. vs (NASDAQ: AMZN) and eBay (NASDAQ: EBAY) are two of the biggest names in online commerce. The two combine to sell hundreds of billions of dollars' worth of goods every year. Both stocks offer ways for investors to ride the trend of growing online sales and the shift away from brick and mortar.

Over the years, the two have grown closer and closer in their retail offerings. Eighty percent of items sold on eBay are brand new, and 87% are sold at a fixed price. Meanwhile, Amazon's third-party merchants account for a greater percentage of its merchandise volume every year. That can make it more difficult for investors to decide which company to invest in.

Let's take a closer look at each company, and determine which is a better buy.

eBay isn't the only website for small businesses anymore

eBay's biggest advantage is its network of buyers and sellers. eBay has 171 million active buyers on its platform, which is very attractive for merchants. But the attraction of eBay has waned in recent years as other big-name online marketplaces have become viable. Amazon, in fact, is probably its biggest threat.

The Fulfillment by Amazon program allows merchants to list items on Amazon's marketplace and ship items in bulk to Amazon's warehouses. That takes out quite a few pain points for merchants, who no longer have to worry about storing inventory and shipping items quickly and to each individual customer.

Even Wal-Mart (NYSE: WMT) is starting to attract the attention of third-party merchants. The company most recently reported 67 million items for sale on its marketplace, up from 10 million at the beginning of fiscal 2017. That's largely due to the influx of third-party merchants selling through its marketplace.

As a result, eBay's gross merchandise volume isn't growing very much. It's up just 2.6% over the past 12 months. By comparison, Wal-Mart reported gross merchandise volume growth of 69% and 67% in the first and second quarters, respectively. Amazon's retail revenue 21.9% in the first six months of 2017, and its third-party seller services revenue is up 35.9% in the same period.

As a result of the slowing gross merchandise volume growth on eBay, it'll be difficult for the company to live up to management's outlook for high-single-digit revenue growth.

Amazon's moat has a moat

Amazon might have the widest moat in retail. Prime has made Amazon the first place most people go to when they want to search for a product online. But Amazon didn't just offer unlimited two-day shipping and call it a day. It continues to add new benefits to Prime every year. With its acquisition of Whole Foods Market, it's making Prime the rewards program for the grocery chain.

Prime is a service that seemingly nobody else can re-create. Wal-Mart tried to offer a similar service and failed. The value it presents gives it a competitive advantage over other services that also offer unlimited shipping benefits or video and music streaming or book rentals (OK, the public library system might have it beat on that one). All of that leads to more people who start their online shopping on instead of its competitors, because they've already sunk some money into a Prime membership.

As a result, Amazon's retail operations continue to thrive. Third-party merchants are increasingly attracted to its loyal customer base, ramping up high gross margin Fulfillment by Amazon revenue. That said, the growth has come at a cost, as Amazon must continually expand its fulfillment network to keep up with demand.

Amazon is expensive; eBay is cheap

eBay is extremely inexpensive compared to Amazon, which may make it more attractive to some investors. eBay shares currently trade around 19.2 times analysts' estimates for 2017 earnings. That compares with a forward P/E of somewhere around 260 for Amazon. But consider that eBay's expected to grow earnings just 7.5% on average over the next five years. Analysts expect Amazon to grow 55.5% per year on average during the same period.

Looking at eBay on a price-to-sales basis doesn't make it look so great compared to Amazon. Amazon trades for 3.1 its trailing-12-month sales. eBay stock is priced 4.5 times sales. Keep in mind that Amazon is growing its sales faster and a lot of its sales growth is coming from higher-margin categories such as third-party merchant services and cloud computing.

Based on the relative growth potential of each company, Amazon looks like a much better buy despite its outrageous P/E ratio.

10 stocks we like better than AmazonWhen investing geniuses David and Tom Gardner have a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.*

David and Tom just revealed what they believe are the 10 best stocks for investors to buy right now... and Amazon wasn't one of them! That's right -- they think these 10 stocks are even better buys.

Click here to learn about these picks!

*Stock Advisor returns as of September 5, 2017

Adam Levy owns shares of Amazon. The Motley Fool owns shares of and recommends Amazon and eBay. The Motley Fool has a disclosure policy.