Home Depot (HD 0.94%) hasn't been a terribly exciting stock to own this year. Up just 5% so far in 2023, its returns lag behind the S&P 500, which is up by close to 18% over the same timeframe. The home improvement retailer is anticipating a slowdown this year as things return to normal and consumers are no longer spending big money on renovations and home repairs.

Despite its declining top line, here are four reasons why Home Depot stock could be a great buy right now.

1. Home Depot's comparable sales are down by just 2%

Although sales aren't likely to rise this year, Home Depot's business is proving to be resilient. In its most recent earnings report for the period ending July 30, net sales of $42.9 billion were down just 2% year over year. For the full year, the company projects comparable sales to drop between 2% and 5%, which isn't a huge decline. 

CEO Ted Decker said that although the business faces some headwinds when it comes to large purchases, "[T]here was strength in categories associated with smaller projects."

2. Home Depot's operating cash flow has improved

Another positive trend for Home Depot is that cash flow remains strong. Over the past two quarters, the company's operating cash flow totaled $12.2 billion, which was up from $7.2 billion a year ago. Cash flow can fluctuate over time due to changes in working capital, but it's an encouraging sign nonetheless that Home Depot is bringing in so much cash.

It reinforces the strength of the business and helps it pay dividends. Plus, it gives Home Depot room to buy back shares. 

HD Cash from Operations (Quarterly) Chart

HD Cash from Operations (Quarterly) data by YCharts

3. Home Depot is buying back $15 billion in shares

In its earnings release, Home Depot announced that its board of directors approved a new $15 billion share repurchase program. Buying back shares is a great sign that the company has robust resources and ample free cash flow.

Not only does the stock pay a dividend that yields 2.5%, which is higher than the S&P 500 average of 1.5%, but buying back shares is another way Home Depot can reward its shareholders. Through buybacks, the stock gets a boost, potentially setting up investors for better returns and overall profits.

4. Inventory levels are down from a year ago

Excess inventory has been a problem for many retailers. It can result in stores reducing prices, and thus margins, in order to clear space and get rid of costs related to holding inventory. In Home Depot's case, however, the company has done a good job of moving inventory. As of July 30, it reported merchandise inventories of $23.3 billion, which was 11% lower than the $26.1 billion it reported a year ago.

HD Inventories (Quarterly) Chart

HD Inventories (Quarterly) data by YCharts

The company has had no trouble moving inventory and it has done so with its gross profit margin remaining largely intact (it has stayed around 33%). It's yet another sign that the business enjoys resilient consumer demand.  

Should you add Home Depot's stock to your portfolio?

Home Depot is better than your average retail stock because it focuses on repairs and maintenance, costs that are often necessary for homeowners. They can be delayed but they are not always avoidable. The company notes that it is facing headwinds right now and yet it's still doing well. When conditions improve and there's an increase in demand for big repairs and construction projects, its financials may look even better.

The stock trades at around 21 times earnings, which is in line with the S&P 500 average. For the resiliency that Home Depot's stock offers and its above-average yield, this is definitely one of the better retail stocks to own today.