Apple (AAPL 0.39%) and Amazon (AMZN 2.10%) have been two chart-topping stocks for the past couple of years. Each is a consumer-oriented technology company that has reached a massive scale. Amazon boasts over 200 million Prime members, and Apple crossed the 1 billion active iPhone mark more than a year ago.

Popularity among consumers is an excellent trait for a company to have, but a good investment requires more than that. Let's pit the e-commerce retailer against the smartphone pioneer and determine which is a better buy for today's long-term investors. 

A person with a credit card in one hand and the other hand on a laptop keyboard.

Image source: Getty Images.

The case for Amazon 

Amazon may be best known for its e-commerce business, but it has other lucrative sources of revenue. In fact, its Amazon Web Services segment brought in all the company's operating income in its most recent quarter, which ended on March 31, despite being only 16% of sales. Amazon's subscription services, which include revenue from Prime memberships, generated $8.4 billion in revenue in the quarter, up by 13% from the same quarter last year. And Amazon has successfully built a robust advertising business that earned $7.9 billion in Q1, up by 25% year over year.

These varied sources of revenue are crucial, considering e-commerce sales are slowing after the pandemic-related surge. E-commerce sales are a low-margin business, as evidenced in the most recent quarter, when Amazon lost money in online sales. Shipping is one big cost. Amazon offers Prime members -- who pay a yearly fee -- fast, free shipping and non-Prime members can get free shipping if they spend over $25 on an order. 

These dynamics have worked to keep Amazon's overall operating profit margin grounded despite rapidly expanding sales. The metric has increased recently as the more profitable segments have taken a larger share of overall sales.

AMZN Operating Margin (TTM) Chart

AMZN Operating Margin (TTM) data by YCharts

The case for Apple

Apple is best known for the iPhone. In the six months ended March 26, Apple sold $122.2 billion worth of iPhones, 55% of total sales. Still, like Amazon, Apple has done a solid job building a services business. During the same six months, Apple's services sales totaled $39.3 billion, a 20% year-over-year jump bringing it to about 18% of the total. The iPhone revenue jump was only 7.6%.

Its services include the App Store, Apple Music, Apple TV+, and iCloud. Again, similar to Amazon, Apple's services segment generates higher profit margins. In the quarter ended in March, Apple's services gross margin was 72.6%, while its products gross margin was 36.4%.

Apple has proven over decades that it can create innovative products that consumers will spend on. More recently, it is proving it can add supplemental services that deliver high profit margins. Indeed, management boasted it had 825 million paid subscribers as of March 26, increasing 165 million over the previous year.

That has undoubtedly helped boost Apple's gross profit margin from 37.8% in 2019 to 41.8% in 2021.

Apple wins this stock showdown

Apple and Amazon are both excellent businesses that will likely make you wealthier if you buy and hold each for five years or more. However, if you had to pick only one, I'd recommend should be Apple. The smartphone pioneer is trading at a substantial discount to Amazon when measured by the price-to-earnings ratio (24 versus 55). Meanwhile, it is crushing Amazon on operating profit margins. 

AMZN PE Ratio Chart

AMZN PE Ratio data by YCharts