Like many industries, retail tends to get hit hard by a recession -- especially companies that sell higher-priced, higher-margin discretionary products.

But big box retailers like Target (TGT -0.54%), Walmart (WMT 0.57%), and Costco Wholesale (COST -0.12%) have lower margins and depend on higher volumes to make money. These companies will get hit during a recession. But thanks to their sophisticated supply chains and pricing power, they'll likely be relatively better off than many other companies in the industry.

Costco stock jumped over 7% on Jan. 6 after the company posted strong December sales numbers. But Target stands out as the best all-around retail stock to buy in 2023, especially for investors who want to buy shares of a company at a reasonable price and collect passive income through a reliable and growing dividend.

A child smiles and puts her hands in the air while being pushed by two adults through a parking lot.

Image source: Getty Images.

Target's profitability is wavering

Even after surging over 13% in the last two weeks, Target stock is still down 40% from its all-time high. And for good reason. The company was blindsided by inflation and a shift in consumer behavior. In 2022, it reported quarter after quarter of disappointing results, and admitted its forecasting underestimated the impact of higher costs.

Target failed to offset higher costs through price increases -- and its operating margin took a major hit as a result. Target went from a 10-year high operating margin to a 10-year low in the span of just one year. Now its operating margin is closer to that of Walmart or Costco.

TGT Revenue (TTM) Chart

TGT Revenue (TTM) data by YCharts

A reasonable valuation

Long-term, Target simply can't afford to conduct business with that low of a margin because it doesn't have the sales volume to support it. Walmart has nearly six times the sales of Target, and Costco has more than double the sales that Target has. To equal Costco's operating income, Target needs double its operating margin. And to match Walmart, it would need an operating margin of around 20%.

Now, this would be a big problem if Target were valued the same as Walmart or Costco. But it's a far smaller company with a market capitalization roughly one-third of Costco's and one-fifth of Walmart's.

TGT Market Cap Chart

TGT Market Cap data by YCharts

If Target can return to its 10-year median operating margin of 6.7%, the stock is going to start to look incredibly cheap. But even now, it sports a forward price-to-earnings ratio of 29, which isn't too bad considering the business is enduring an earnings and operating margin collapse. 

A passive income machine

Target is more dependent on discretionary spending than Walmart and Costco, so its performance will likely be more volatile and dependent on economic cycles.

But even when the company is faced with myriad challenges, Target is still highly profitable, and is able to support a growing dividend. The dividend is a vital aspect of the long-term investment thesis for Target. It yields 2.7%, which is far higher than Walmart's 1.5% yield or Costco's 0.7% yield. 

Target is also a Dividend King, which means an S&P 500 component that has paid and raised its dividend for at least 50 consecutive years.

Cyclical companies that have track records of consecutive dividend raises no matter the market cycle are arguably some of the greatest stocks to own long-term. That's because even during a downturn, an investor can count on a passive income stream to incentivize holding through volatility. And during an expansion, the company can make outsized profits that can be reinvested in the business or used to improve the balance sheet.

Target is a balanced buy now

There's no sugarcoating that Target's prospects are arguably worse than Walmart's or Costco's over the short term. But long term, the company's margins should improve, and it will likely stand out as the clear winner of this set of three companies.

Costco has historically been the fastest-growing company of the three. But it is also the most expensive, and has too small of a dividend to be considered a reliable source of passive income. For that valuation, an investor can find much faster-growing companies than Costco.

Walmart is a slow-growing, reliable business. It's one of the most powerful retail companies in the world, and can undercut its competitors with ease. But it too is an expensive stock that has a low dividend yield. Investors can find equally strong companies at a lower valuation and a higher dividend yield.

Target gives investors the best balance among the three stocks. Its normally high operating margins, strong brand, reasonable valuation, and rock-solid dividend provide a nice blend of growth, value, and income.

Target could very well underperform Walmart and Costco in 2023. But over the next five to 10 years, it stands out as the best buy of the three.