Let's compare two well-known American consumer goods companies that have shown strength amid multiple economic downturns. Which makes a better buy in today's market?

The case for Home Depot

Although Home Depot (HD -0.60%) stock stands more than 25% below its all-time high from late 2021, the stock also recovered nicely from its fall 2022 lows. Is the home improvement retailer's recent performance reflected in the stock price? Let's take a closer look.

The Atlanta, Georgia-based company posted $38.9 billion in revenue for Q3 2022, a 5.6% increase year over year. Digital sales, fueled by exclusive product offerings and shorter delivery times, jumped 10% for Home Depot. Same-store sales, or comp sales, enjoyed a 4.3% lift thanks to a growing do-it-yourself market. 

Despite increasing sales, Home Depot continues to face global supply chain challenges. Gross margin took a 10-basis-point hit in Q3, "primarily driven by supply chain investments," according to CFO Richard McPhail. Nonetheless, Home Depot reaffirmed its full-year 2022 guidance, expecting to close out 2022 as anticipated. 

During last quarter's earnings call, McPhail affirmed that long-term demand remains robust, thanks to Home Depot's loyal customer base. The company expects current challenges to persist this year, but it's also observed easing in certain areas such as lumber. 

The case for Walmart

After reaching a high of nearly $148 earlier this month, Walmart (WMT -0.32%) stock fell roughly 5% to its current level in the $140 range. Investors want to know if the stock can recover from its recent downslide, and more importantly, whether it can push to new heights.

The discount retail behemoth grew sales across all segments last quarter and, as a result, raised its full-year guidance by 1%. Total revenue for Q3 2022 reached over $150 billion, including Walmart U.S., Walmart International, and Sam's Club.

Digital sales also buoyed Walmart during the third quarter. It enjoyed 46% year-over-year growth in online commerce. In the first three quarters of 2022, 13% of Walmart's sales were started "in a digital fashion," and online sales grew 16% sequentially between the second and third quarters alone.

However, while Walmart's sales grew, profit margins dwindled substantially. The Bentonville, Arkansas-based company reported a $1.8 billion loss compared to last year's $3.1 billion profit in the third quarter, largely attributed to inflation and unfavorable currency exchange rates. Markdowns also took a toll on profitability last quarter, dropping gross profit margin by 89 basis points.

With improvements planned to navigate the current environment, such as better vendor sales agreements that reduce overhead costs, Walmart raised its full-year 2022 guidance from 4.5% to 5.5%. Encouraged by a new wave of higher-income shoppers accumulated during the pandemic, CFO John David Rainey feels Walmart is "well-equipped to continue gaining market share" in the current consumer environment.

Which stock is the better buy?

To determine whether Home Depot or Walmart makes the better buy right now, let's compare their price-to-book ratios and one-year growth estimates.

Metric Home Depot Walmart
Market cap $337.56 billion $391.82 billion
Price-to-book ratio 260.07 5.42
One-year growth estimate 1.4% 7.4%

Table data: Yahoo! Finance.

Because of its much lower price-to-book ratio and a significantly better one-year outlook, Walmart is today's winner. But Home Depot remains well-positioned for long-term growth, as long as current demand for home improvement persists.