Apple (AAPL 1.21%) and Microsoft (MSFT 0.56%) were founded in 1976 and 1975, respectively. They've remained relevant in an ultracompetitive environment. More than that, both have been tremendously profitable and handsomely rewarded investors.
Over the last 10 years, through Aug. 15, Apple and Microsoft's shares appreciated 688.4% and 992.5%, respectively. The gains dwarfed the S&P 500 index's 206.5%.
Looking forward, which stock has the better long-term investment potential?

Image source: Getty Images.
Apple
The legendary Steve Jobs co-founded Apple. Upon his return to the company in the mid-1990s, it became a juggernaut of building "cool," must-have products. These include the iPod and iPhone.
Flash forward, and the iPhone produces the biggest share of Apple's sales. The product's fiscal third-quarter sales were $44.6 billion (over 47% of the period's top line), up 13.5% year over year. The period ended June 28.
Apple's iPhone global market share fluctuates from quarter to quarter, but it stood at 19% in the first calendar quarter. That was just behind Samsung Electronics' 20%.
Certainly, that's positive news. However, Apple will need to continue innovating to remain relevant. Currently, its generative artificial intelligence products haven't been well received by users.
It has other products, of course. But its services business stands out as particularly strong. This includes advertising, product support, the App Store, and payment services. The segment produced $27.4 billion in sales, up 13% compared to a year ago. It also has a much higher gross margin than product sales. Services' third-quarter margin expanded by 1.6 percentage points to 75.6%.
Still, Apple hasn't released much in the way of new products lately. That includes management's decision last year to cancel its decade-long effort to launch a self-driving electric car. And it hasn't talked much about widely anticipated Vision Pro, the company's $3,500 headset that it started selling in early 2024.
Microsoft
Microsoft sells a host of products for consumer and business use. These include Microsoft 365 (which includes the Office suite, cloud storage, and Outlook email), LinkedIn, cloud services, Windows, and the Xbox game consoles and content.
It organizes the business into three segments: productivity and business processes (43% of fourth-quarter revenue), intelligent cloud (39% of revenue), and more personal computing (18% of revenue).
Microsoft has been operating on all cylinders, with each division doing well. Its fiscal fourth-quarter revenue, adjusted to remove foreign-currency translation effects, grew 17% from a year ago. This helped propel the company's adjusted operating income 22% higher. Microsoft's fiscal year ended June 30.
There wasn't a single product driving higher sales, which is good to see. Azure and other cloud services, Microsoft 365 for consumers and businesses, server products and cloud services, and search/news were just some of the areas that produced double-digit percentage revenue growth.
Notably, Azure remains a growth area as companies clamor for data. The cloud services product grew sales 39% in the fourth quarter, and the business produced more than $75 billion in annual revenue. Dominated by large companies that have the resources to build large data centers, it faces limited competition. Azure's 20% market share trails only Amazon's Amazon Web Services' 30% share.
The choice
The companies' share prices have moved in opposite directions. Microsoft's stock gained 19.7% year to date through Aug. 20. That's more than double the S&P 500's 8.4%. During this time, Apple's shares lost 10.3%.
Turning to valuations, Microsoft's shares trade at a price-to-earnings (P/E) ratio of 37, slightly higher than Apple's P/E multiple of 34. Both have higher valuations than the S&P 500's P/E ratio of 30.
However, given Microsoft's broad product appeal and growth prospects, I think the shares deserve a higher multiple than the market. I'd choose the stock over Apple, which remains highly reliant on its iPhone, making the company a riskier proposition.