In some respects, Costco (NASDAQ:COST) and Dollar General (NYSE:DG) represent different ends of the retail spectrum. Costco has developed a reputation for delivering high-quality items in bulk amounts at reasonable prices. Dollar General competes in what some might call the "extreme discount" sector. This subsection of retail arguably makes discounters such as Costco or Walmart appear comparatively expensive.

However, both companies have prospered by offering comparatively low prices on products to a specific segment of the market. During the COVID-19 pandemic, authorities considered them both "essential" businesses. The fact that both companies sell consumer staples allowed them to come through the recent market swoon with minimal damage.

However, investors cannot assume that these discounters offer a bargain on their stocks. Prospective buyers have flocked to these stocks over the past few years as expansions and rising sales fueled revenue and earnings growth. Now, with both companies operating stores spread across the country, investors are shopping both of these retail stocks to see which one will more likely offer a better deal. Let's take a closer look at each and see if we can determine which stock is the better buy.

a shopper pushes a cart through a warehouse club store with large shelves on either side.

Image source: Getty Images.

The case for Costco

Despite a comparatively strong performance for the year, Costco did not wholly escape the effects of the pandemic. During April, comparable sales fell by 4.7% year over year. Although customers rushed to clear warehouses of consumer staples, the company suffered as its food courts, optical services, and travel services came to a standstill.

However, investors should expect these parts of the company to reopen soon. Despite the turmoil, shareholders did not sell off this stock to a large degree. Though the stock price is still down from late February highs, it recovered quickly from the steep market selloff in March and is up by about 6.5% since the beginning of the year.

COST Chart

COST data by YCharts.

Hence, those hoping Costco stock would remain less expensive did not get their wish. The forward P/E ratio now stands at just under 32.2. This comes in well ahead of the five-year average forward multiple of 28.3. Admittedly, with earnings increases expected to average 6.56% per year over the next five years, Costco stock remains pricey.

Along with its regular quarterly dividend, Costco shareholders are rewarded with a substantial special dividend every few years at the company's discretion. Still, with the dividend yield hovering at approximately 0.9%, even a 16-year streak of yearly dividend payout hikes will likely not attract investors. S&P 500 investors see an average dividend yield of just under 2.1%.

Nonetheless, investors should expect growth to continue. With Costco locations in most of the U.S.'s major metro areas, the company has looked internationally for expansion. The foreign locations performed nearly as well as its U.S. warehouses. When excluding Canada, these offshore locations saw comparable sales drop by 4.6% in April, slightly outperforming the company's average.

Costco stock has become pricey in contrast to most of its warehouse items. However, as a company that can perform relatively well in any business environment, it should continue to deliver long-term returns to shareholders.

products line the shelves of a Dollar General DGX store

Image source: Dollar General.

Why investors should consider Dollar General

Although Dollar General grew as the economy prospered, the current environment might play into the hands of Dollar General. With 14.7% of U.S. workers currently jobless, Dollar General's discounted consumer staples product line might offer an attractive alternative when budgets are tight. Also, with nearly 16,400 stores in 45 states, most Americans live near a Dollar General, providing convenient access.

The company has not released any sales figures since the coronavirus pandemic began to lead to area shutdowns. Dollar General stock bounced back from a mild downturn in mid-February and recovered quickly. It has risen by around 26.5% since early January. Today, it trades near its all-time highs.

DG Chart

DG data by YCharts.

This has taken the company's forward P/E ratio to about 24.3, a multiple that has averaged about 18.2 for the last five years. However, analysts forecast that profit growth will average 10.89% per year for the next five years.

Much like Costco, investors are unlikely to flock to this stock for the dividend. The payout currently yields around 0.8%. The company has increased this payout for four years in a row. Nonetheless, with the yield so far below the S&P 500 average, investors will probably not feel motivated to buy for this reason.

Moreover, one might assume Dollar General has little room for expansion. The company runs a large number of stores, and its presence in so many states with no apparent plan to open in other countries might create concern.

However, in December, the company set a goal to open 1,000 new stores in fiscal 2020. It remains unclear how COVID-19 affected that goal. Still, with a brisk pace of store growth still possible within the U.S., the company may not have to worry about where else it will go for the foreseeable future.

Dollar General stock trades near its all-time highs. Nonetheless, with long-term projected double-digit earnings growth and the company's ability to grow regardless of the economy, Dollar General should continue to prosper.

Costco or Dollar General?

Although I expect both stocks to rise in the long run, I have to give the edge to Dollar General right now.

Indeed, the higher earnings growth rate along with the lower forward multiple help to make Dollar General more attractive. The challenging economic environment and the ability to continue its expansion override my concerns for store-count saturation.

Given these conditions, seeing the stock trade at record highs is understandable. Even if Dollar General stock doesn't trade at dollar-store prices, investors will likely continue to buy it.