Artificial intelligence (AI) isn't just a technology trend -- it's transforming the word we live in. As such, investing in leading AI companies for the long haul could be a smart move.

Let's look at five AI stocks you can buy and hold for the next decade.

Artist rendering of AI chip.

Image source: Getty Images.

1. Nvidia

When it comes to AI infrastructure, Nvidia (NVDA 1.06%) is the clear leader. Its graphic processing units (GPUs) are the main chips used to train and run AI workloads. The company had an over 90% market share in the GPU market in Q1, while its data center revenue has jumped more than 9x over the past two years. That kind of growth from a $4.17 trillion company is almost unheard of.

The company's wide moat comes from its CUDA software platform, which it pushed into universities and research labs long before AI became mainstream. As a result, CUDA became the primary platform on which developers learned to program GPUs, and a plethora of libraries and tools were built on top of its software to help optimize the performance of its chips for AI.

Outside of AI, Nvidia's auto segment is also seeing strong growth. Revenue hit $567 million last quarter, with the company projecting $5 billion for the year. With the advent of autonomous driving, this could become another big growth leg for the company in the future.

2. Taiwan Semiconductor Manufacturing

Today, most chipmakers don't manufacture their own chips; they just design them. That is where Taiwan Semiconductor Manufacturing (TSM 3.38%) steps in. It is the world's leading semiconductor contract manufacturer, making chips for leading chip designers like Nvidia, Advanced Micro Devices, Apple, and Broadcom.

Manufacturing advanced chips isn't an easy process, as it requires both scale and technological expertise. Foundries are constantly racing to shrink node sizes, as the more transistors that can be packed onto a chip, the better a chip's performance and power efficiency.

TSMC has a wide lead in advanced node manufacturing. Chips built on 7nm and smaller nodes made up 73% of revenue last quarter, while 3nm chips alone accounted for 22%. Apple has already locked in future supply for its 2nm line.

As rivals have struggled, TSMC has become a vital partner to leading chip designers. This has given it pricing power, as chip designers work closely with the company to secure future capacity to meet growing demand for advanced chips.

3. ASML

While TSMC manufactures advanced chips, ASML (ASML -1.31%) is the company that provides the equipment that makes it possible. It has a near-monopoly on extreme ultraviolet lithography, which is the technology used to make advanced chips.

ASML's business is driven by chipmaker capital spending. With TSMC and Intel planning to invest hundreds of billions into new capacity, ASML will benefit. As long as demand for advanced chips keeps rising, it should continue to see solid demand moving forward.

The company also recently introduced a new technology called a high numerical aperture extreme ultraviolet lithography system, or High NA EUV. This technology will help shrink chip sizes even further. While TSMC has balked at these machines' nearly $400 million price tag, last quarter it shipped its fifth High NA EUV system. It now has machines placed at the three largest semiconductor contract manufacturers, and none of them are likely going to want to fall behind.

With companies looking to design more powerful AI chips in the future, ASML looks well-positioned for the long run.

4. Meta Platforms

Meta Platforms (META -0.23%) owns one of the most powerful digital ad platforms in the world, and AI is making it better. Its Llama model is increasing personalization and engagement across Facebook and Instagram, which is driving strong revenue growth. In Q1, its ad impressions rose 5%, while pricing climbed 10%. That's a strong sign that users are spending more time on its apps, and that advertisers are getting more value from the platform.

Meta's new AI tools are helping marketers generate better creative content and target users more effectively. That makes campaigns better and increases return on ad spend, which keeps advertisers coming back. Meta is also investing heavily in its AI infrastructure, giving it more control over performance and cost.

The company is also just starting to serve ads on both its messaging platform, WhatsApp, and its new social media site, Threads. WhatsApp has more than 3 billion users, and Threads has already hit 350 million. As such, both have a long runway of ad growth ahead.

Overall, Meta looks well-positioned for an AI world.

5. Alphabet

Alphabet's (GOOGL 0.36%) (GOOGL 0.36%) moat should not be underestimated. While investors fear that AI will disrupt its core search business, investors are missing what Google truly does. Google isn't about search; it's about content discovery, and whether that is delivered via traditional search or AI, the company has a few big advantages.

Its biggest advantage is distribution. Its Chrome browser has a more than 65% browser market share, while its Android operating system runs on more than 70% of smartphones. It's also the default search engine on Apple devices and partners with other browsers like Opera. The company also has decades of user search data and the world's largest ad network, with unprecedented scale and reach.

Importantly, Google is integrating AI into products people already use. Its new AI Mode in search turns Google into an AI assistant, not just a list of links. A recent Oppenheimer survey showed 82% of users found it more helpful than traditional search, and 75% said it was more useful than ChatGPT. That's a strong signal that Google is getting this right.

Its cloud computing unit, Google Cloud, is also gaining momentum. Q1 revenue rose 28%, and operating income more than doubled. Cloud customers are using Google's Vertex AI tools to train and deploy models. It even has developed its own custom AI chips, which even OpenAI has been testing.

Meanwhile, Waymo is another underappreciated asset. It's now running over 250,000 paid robotaxi rides per week and has started expanding into new markets through its Uber partnership. Alphabet's Willow quantum chip is also showing real progress in reducing error rates. This may take years to play out, but it could be another growth engine down the road.

Overall, with its combination of leading and emerging businesses, Alphabet looks like one of the best AI stocks to own over the long term.