The retail industry is vast, with the U.S. market soaring from a value of $3 trillion in 2000 to over $7 trillion in 2022. The rise of online shopping and digital forms of payment has expanded the industry and given companies new avenues for boosting earnings.

Apple (AAPL -0.35%) and Costco Wholesale (COST 1.01%) operate in significantly different areas of retail, with one focused on consumer electronics and the other on wholesale grocery. However, both of these companies have delivered triple-digit stock growth over the last five years and have built up immense consumer loyalty.

Apple and Costco have some exciting developments in the works for the new year, making now an excellent time to consider an investment in their stocks. So let's examine whether you're better off with Apple or Costco stock in 2024.

Apple

Despite offering a considerably smaller range of products than most retailers, Apple ranks 11th out of the top 100 leading U.S. retailers, according to Statista.

The popularity of devices like the iPhone, the MacBook, AirPods, and the iPad is unmatched. Meanwhile, an easy-to-use design language and interconnected system between all of Apple's products encourage consumers to stick with the company for the long haul.

In fiscal 2023, the tech giant posted a revenue dip of 3% year over year. Macroeconomic declines caught up with Apple as marketwide headwinds led to reductions in consumer spending. However, recent data suggests the tech market might finally be in recovery.

The fourth quarter of 2023 saw smartphone shipments increase 4% year over year after almost two years of declines. PC shipments similarly returned to growth in the quarter, rising 0.3%. Market improvements have yet to be reflected in Apple's earnings, but it's a promising sign for 2024.

Apple generated nearly $100 billion in free cash flow despite market challenges last year. Alongside a booming digital services business and expansions in AI, I wouldn't bet against the company's long-term future. It has the brand power and cash reserves to come back strong and flourish over the next decade.

Costco

Costco ranks third on the list of 100 biggest U.S. retailers. Meanwhile, as seen in the chart below, it has delivered significantly more stock growth over the last five years than some of its biggest American rivals.

COST Chart

Data by YCharts

The company has won over consumers worldwide with its unique business model of charging an annual subscription fee for access to market-low prices in a wholesale setting. Product sales don't actually amount to much in profit. However, the company has rectified that with its membership-based business model.

In fiscal 2023, Costco hit more than $6 billion in profits, with membership fees making up 73% of that figure. Alongside a 90% subscription renewal rate, the company is crushing it in retail.

Moreover, the company has managed to keep investors happy with consistent growth and surprise dividends that are substantially bigger than its usual dividend yield of 0.61%. On Jan. 12, the company paid out a dividend of $15 per share, with its last special dividend released in 2020 for $10 per share.

A winning business model and happy investors make Costco's stock seem like a no-brainer for anyone looking to invest in retail.

Is Apple or Costco the better stock to buy in 2024?

Apple and Costco dominate their respective markets, each profiting from some of the most loyal userbases in retail. However, just because a company leads an industry doesn't necessarily mean it's trading at the right price.

The following data suggests Apple's stock currently offers far more value than Costco.

COST PE Ratio Chart

Data by YCharts

This chart compares Apple and Costco's price-to-earnings ratios (P/E) and price-to-free cash flows (P/FCF). For both valuation metrics, Apple's lower figures indicate its stock is the cheaper option.

P/E is calculated by dividing a company's stock price by its earnings per share. Meanwhile, P/FCF divides its market cap by free cash flow. For both metrics, the lower the figure, the more value a stock offers.

These metrics are helpful in determining a stock's value as they take into account a company's financial health. Apple wins on both fronts, with its share price a bargain compared to Costco's. Along with an improving tech market and expansions into high-growth sectors like AI, the company is the better stock in 2024.