The post-COVID world has been a difficult one for most traditional brick-and-mortar retailers.

But the pandemic proved to be a boon for many stores selling basic necessities. It was a windfall for companies with a strong internet presence or pickup and delivery options.

Let’s take a look at two big-box retailers that have fared particularly well in 2020, Walmart Inc. (NYSE: WMT) and Target Corp. (NYSE: TGT).

Both are essential “everything” stores. You could literally live in a Walmart or Target store for years and have everything you’d need to survive and entertain yourself.

Both of these chains raked it in during the virus quarantines because most of their competition was closed.

On top of that, both companies adapted during the pandemic lockdown. App-based curbside delivery gives both chains a durable leg up on the competition. And as discount retailers, both should continue to fare well in a soft economy.

Walmart shares are up about 16% year to date, and Target shares are up about 19% this year.

But we wondered: Which of these two essential retailers is the better buy?

So I took a look at both using Adam O’Dell’s Green Zone Ratings system.

Walmart boasts an overall score of 77, putting it in the top quarter of all stocks in our universe. And Target isn’t far behind, at 72.

That’s close enough to warrant a deeper dive.

Walmart Stock vs. Target Stock

Volatility — Both Walmart and Target rate highly on volatility at 99 and 98, respectively. Remember, low-volatility stocks get a higher rating. And both Walmart and Target are low-volatility consumer staples.

Quality — It’s a really tight race in terms of quality as well. Target narrowly edges out Walmart (84 vs. 82). Target rates slightly higher on cash flows (97 vs. 95). But Walmart rates a little higher on capital efficiency (98 vs. 97). Overall, both of these retailers are high-quality companies.

Value — Based on our Green Zone Ratings criteria, Walmart is a slightly better value than Target (72 vs. 66). In both cases, this is driven by a high price-to-sales ratio. Walmart rates a 90 and Target a 93. But Walmart edged out Target on most other value metrics.

Momentum — Neither Walmart nor Target stands out based on momentum. This seems to be the exclusive domain of high-octane tech stocks these days. But Walmart and Target rate 65 and 63, respectively. That’s not too shabby for two stodgy old retailers.

Growth — Based on growth, both retailers fall in the middle of the pack. Walmart rates a 52 and Target rates a 46. Remember, a rating of 50 means the stock is exactly average. Even while these companies have enjoyed a nice sales bump during the pandemic, it hasn’t been enough to push them to the top of our stock universe.

Size — In this metric, smaller companies get higher rating because, historically, smaller companies have outperformed their larger rivals. Walmart and Target are both enormous companies with market caps of $392 billion and $75 billion, respectively. Walmart rates a little higher than Target (3 vs. 1). Despite being a larger company, Walmart’s shares are more liquid than Target’s. That explains the slightly higher size rating.

cannabis CBD Walmart vs. Target stockTakeaway: It’s a really close call. You would do just fine buying and holding both.

But Walmart rates higher than Target in its composite score and in four out of the six individual categories. According to our Green Zone Rating system, Walmart is the better buy.

Money & Markets contributor Charles Sizemore specializes in income and retirement topics. Charles is a regular on The Bull & The Bear podcast. He is also a frequent guest on CNBC, Bloomberg and Fox Business.

Follow Charles on Twitter @CharlesSizemore.