Wal-Mart (WMT 0.57%) and Costco (COST -0.12%) are the two of the world's leading retailers , direct competitors in the savagely aggressive discount retail industry. Which of course lends itself to the question: which one is a better purchase for investors right now: Wal-Mart or Costco?

A tale of two retailers
The two companies operate in discount retail, a remarkably competitive industry in which profit margins are notoriously thin and brick-and-mortar players are facing a lot of pressure from online retailers such as Amazon (AMZN -1.65%). However, while the similarities between Wal-Mart and Costco are quite evident, investors should not overlook their differences.

Costco's business model is based entirely on the warehouse retail model. The company makes most of its profit from membership fees, not from markups on product sales. This is a big advantage for both customers and the company, since it allows Costco to sell its products for razor-thin profit margins, sometimes even at a loss for a particular item.

Source: Motley Fool Flickr

Wal-Mart has a presence in warehouse retail via its Sam's Club division, but it still represents less than 12% of total revenue. The company's main advantage is its scale, not so much the business model. Wal-Mart owns over 11,500 stores around the world, and it produced nearly $482 billion in sales during the year ending Jan. 31, 2016. This tremendous scale allows Wal-Mart to negotiate conveniently low prices with suppliers, which the company then translates into "everyday low prices" on its shelves.

Costco is no small company by any means, in fact, it comes in second position behind Wal-Mart among publicly traded retailers on a global scale. However, Costco is still nearly one-quarter the size of Wal-Mart in terms of total revenue.

Costco is materially outgrowing Wal-Mart
Costco's business model resonates remarkably well among customers. The company has ranked at the top of its industry in the American Customer Satisfaction Index in every year since 2001, and it consistently beats Wal-Mart. For 2015 Costco has a customer satisfaction score of 81, substantially higher than the customer satisfaction score of 76 earned by Wal-Mart's Sam's Club warehouse retail division.

Superior customer satisfaction and a smaller store base, which generally means more opportunities for rapid expansion, have allowed Costco to outperform Wal-Mart by a wide margin over the last several years.

WMT Revenue (TTM) Chart

WMT Revenue (TTM) data by YCharts.

Judging by the latest earnings reports from the two retailers, there is no sign of a reversal in the competitive dynamics between Costco and Wal-Mart. Costco reported a big increase of 6% in comparable sales excluding the negative impact from foreign exchange fluctuations and gasoline price deflation during the 22-week period ending Jan. 31, 2016. Wal-Mart, on the other hand, registered a much more modest increase of 2.1% in constant currency sales last quarter.

Wal-Mart is on sale
One big advantage Wal-Mart stock offers above Costco is that the entry price is far more attractive. Wal-Mart is currently trading at a price to earnings ratio of 14 times earnings over the last year, a discount versus an average price to earnings ratio around 18 for companies in the S&P 500 index. Costco is much more expensive: The stock carries a price to earnings ratio around 28, a premium versus the broad market and nearly double the valuation currently being assigned to Wal-Mart stock.

Source: Motley Fool Flickr

The same goes for dividends, Wal-Mart stock is paying a dividend yield of 3% at current prices, not bad at all coming from a company which has increased its dividends in each and every year since paying its first dividend in 1974. Costco has generously rewarded investors with special dividends of $7 per share in 2012 and $5 per share in 2015; however, regular dividends are $1.60 per year, equating to an uninspiring dividend yield of 1% at current prices.

Wal-Mart or Costco?
Both Wal-Mart and Costco offer some attractive traits for investors, and the right decision would depend on your own risk tolerance, investment philosophy, and your vision of the future for the two companies. 

If you're looking for a solid, defensive dividend stock trading at an attractive valuation, then Wal-Mart is the way to go. On the other hand, Costco is much stronger when it comes to growth potential, and everything indicates that it will continue outperforming Wal-Mart in the coming years. If you're willing to pay up for quality and growth, chances are Costco will deliver bigger returns than Wal-Mart over the long term.