While the economy may look a bit concerning now, it pays to look out a few years. Take the home improvement market, which is expected to grow at a nearly 5% pace through 2028. The two Goliaths of the sector -- and longtime rivals -- are Home Depot (HD -1.77%) and Lowe's Companies (LOW -1.40%).

Read on to see which of these two home improvement giants makes a more compelling buy in today's market.

1. Home Depot is on a roll

Founded in 1978, Home Depot transformed the hardware store as we know it. Now the largest home improvement retail chain in the world, it operates more than 2,300 stores across North America, employs half a million associates, and brought in over $151 billion in revenue last year.

When founders Bernie Marcus and Arthur Blank opened their first Home Depot stores in Atlanta, Georgia, they realized their vision: A one-stop shop for all things home improvement. At roughly 60,000 square feet each at the time and offering a much greater variety of products, the first Home Depot stores instantly dwarfed existing hardware stores of the 1970s.

Home Depot storefront as seen from parking lot.

Image source: Home Depot.

Today, the average Home Depot store spans 105,000 square feet and contains over 35,000 products for sale. And Home Depot claims to offer more than 1 million products online through its e-commerce store. The company also provides home remodeling and other services, boasting "the industry's largest installation business for the Do-It-For-Me customer."

Home Depot has shown exceptional strength this year, delivering its highest-ever quarterly sales and earnings in the second quarter. According to CEO Ted Decker, "Our performance reflects continued strength in demand for home improvement projects." The company posted a record $43.8 billion in sales, a 6.5% increase over the same period last year. For the full year, Home Depot expects total sales to grow roughly 3% over 2021 numbers, with an operating margin of about 15.4%.

2. Lowe's delivers strong business sales growth

More than 50 years before Home Depot opened its doors, Lowe's began as a small-town North Carolina general store. In addition to sewing supplies, horse tack, and snuff, L.S. Lowe's original 1921 store also sold hardware and building materials. Today, Lowe's serves roughly 19 million customers per week out of its nearly 2,200 stores, and the company posted sales of over $96 billion in fiscal 2021.

However, it wasn't until 1946 that Lowe's became a hardware store exclusively. That's when the company adjusted its inventory to accommodate a post-World War II construction wave. Lowe's went public in 1961 and has since grown into one of the world's largest home improvement retail chains. Like Home Depot, it also operates in the U.S., Canada, and Mexico. 

Lowe's associate helping shopper with flowers in garden center.

Image source: Lowe's.

Joining the metaverse revolution over the summer, Lowe's unveiled its virtual reality platform, Lowe's Open Builder. This new tool allows shoppers to download digital versions of Lowe's products -- home décor and furniture products, for example -- and then preview those items in their homes or yards with augmented reality. Using Lowe's Open Builder, customers can get a realistic idea of how items will look before making any buying decisions.

Lowe's hasn't performed as well as Home Depot this year, and in Q2, it saw a slight drop in sales versus last year. Although DIY sales were lower than expected, Lowe's was able to make it up with a 13% increase in "Pro" customer category -- that is, sales to contractors, professional remodelers, and facility maintenance businesses. Looking forward, CEO Marvin R. Ellison remains steadfast in the company's ability to grab additional share of the home improvement market.

Which is the better buy?

To help gauge whether Home Depot or Lowe's is the better buy, let's look at current market capitalizations, price-to-earnings ratios, and dividend yields.

Metric Home Depot Lowe's
Market capitalization $296.7 billion $123.5 billion
Price-to-earnings ratio 17.8 15.7
Dividend yield 2.62% 2.11%

Source: E-Trade

On one hand, Lowe's has a slightly lower price-to-earnings ratio than Home Depot -- at 15.7 vs. 17.8. On the other hand, Home Depot offers a higher dividend yield to shareholders and is having a banner year. 

With momentum currently in its favor, Home Depot makes a better buy than Lowe's right now. However, as the two biggest contenders in a market expected to reach over a trillion dollars by the end of 2028, both of these home improvement stocks show long-term promise.