At the beginning of 2010, the largest stock by market cap that traded on a U.S. stock exchange was an oil producer. Only two tech stocks ranked in the top five.

It's a much different story today. All five of the biggest stocks focus largely if not completely on technology. Will the future hold even greater surprises? Maybe, but I don't think so. These will be the five largest stocks by 2030, in my opinion.

1. Apple

Apple (AAPL 0.62%) is the biggest company in the world today with a market cap of $2.7 trillion. I expect it to hold onto this top spot through 2030 and likely beyond.

New versions of Apple's iPhone will almost certainly keep customers upgrading regularly for years to come. Services, including the App Store, Apple Card, and iCloud, already have become a huge growth driver for Apple and should continue to gain momentum.

I also anticipate that augmented reality and virtual reality could be major tailwinds for Apple later in the decade. The tech giant might not grow as fast as some of the others in the top five. But with Apple's current market-cap advantage, it doesn't have to.

2. Microsoft

Microsoft (MSFT 0.69%) trails behind Apple a bit right now with its market cap of $2.3 trillion. I won't be surprised if the company narrows the gap considerably over the next few years. Microsoft could even vault past Apple, but I suspect it will still come in a close second place.

The big growth driver for Microsoft is easy to identify: artificial intelligence (AI). Microsoft's partnership with (and significant investment in) OpenAI has turned out to be a brilliant move.

I look for Microsoft's Azure cloud platform to be a big winner from its integration with OpenAI's generative AI technology. Gaming is another big growth opportunity for Microsoft as well, especially with its pending acquisition of Activision Blizzard

3. Alphabet

There's a sizable gap between the market caps of Microsoft and the current third-largest stock -- Alphabet (GOOG 0.60%) (GOOGL 0.71%). The Google parent is valued at more than $1.6 trillion right now. I predict that Alphabet will be much larger by 2030 but still lag behind Microsoft.

Earlier worries that generative AI would disrupt Google Search appear to have been overblown. Alphabet is receiving positive user feedback from its integration of generative AI with Google Search (called Search Generative Experience -- SGE). The company believes that SGE helps it deliver ads to users even more effectively.

AI should benefit from Alphabet's cloud-services business in a huge way. More than 70% of the generative AI unicorns use Google Cloud. I expect that Google Cloud will become a much larger growth driver for Alphabet over the next few years.

4. Amazon

Would it be shocking for Amazon (AMZN 0.27%) to claw its way into the top-three biggest stocks? Not at all. However, I still look for the e-commerce and cloud-services giant to take the No. 4 spot by 2030.

Amazon has room to grow further in e-commerce despite already dominating the market. It also has opportunities with expanding into new markets such as healthcare.

The primary growth engine for Amazon, though, will likely remain its cloud unit. Amazon Web Services (AWS) claims the largest market share today. Although it faces increasing competition from Microsoft Azure, Google Cloud, and others, I expect that AWS will continue to be the powerhouse behind Amazon's growth. 

5. Nvidia

Nvidia (NVDA 1.06%) didn't crack the top five until earlier this year. But with the stock roughly tripling in value, Nvidia now has a solid spot among the biggest stocks trading on U.S. stock exchanges. 

I know that some predict that Nvidia will move even higher in the ranking over the next few years. While I agree that's a possibility, my hunch is that the chip stock will instead retain its current position in 2030.

Nvidia certainly has tremendous growth prospects. Its graphics process units (GPUs) are well suited for AI apps. I don't expect that's going to change. And, like many, I think the demand for Nvidia's GPUs will increase significantly throughout the decade. However, much of the company's projected growth is already priced into the stock.