These companies are benefiting from massive AI trends that could persist for years.

It’s no surprise to anyone interested in investing that owning tech stocks is one of the best ways to experience impressive gains. Unfortunately, not all tech stocks that are soaring right now will continue to do so in the coming years.

How can investors find the best ones to buy and hold for years to help set them up for life? It’s best to focus on companies benefiting from a massive trend — like artificial intelligence (AI) — and that carved out a niche in that space. Here are three that have done just and could bring significant gains for years to come.

A person looking at a chart.

Image source: Getty Images.

1. Micron’s memory play will continue to be huge

If you’ve never heard of Micron Technology (MU +1.46%), the company designs and manufactures memory, DRAM, and NAND, which have become key necessities in artificial intelligence data centers. Demand for memory driven by AI is so high that Micron’s executive VP of Operations, Manish Bhatia, recently said, “The shortage we are seeing is really unprecedented.”

As key supplier of memory to Nvidia and other AI companies, Micron is already benefiting from this demand and in the first quarter (which ended Nov. 27), the company’s revenue increased 57% to $13.6 billion, and non-GAAP (generally accepted accounting principles) earnings per share rose 167% to $4.78.

To help meet the rising demand for AI memory, Micron recently broke ground on its first of up to four factories in the U.S., investing up to $100 billion over the next two decades to build more memory plants. That’s a clear sign that Micron sees memory demand remaining for many, many more years ahead.

Micron Technology Stock Quote

Today’s Change

(1.46%) $5.69

Current Price

$394.80

Key Data Points

Market Cap

$438B

Day’s Range

$376.92 – $396.76

52wk Range

$61.54 – $396.76

Volume

1M

Avg Vol

28M

Gross Margin

45.53%

Dividend Yield

0.12%

2. Alphabet’s Gemini continues to gain ground

Alphabet’s (GOOG +1.05%) (GOOGL +0.97%) Google Gemini is currently playing second fiddle to OpenAI‘s ChatGPT, but the company has made significant gains recently that could eventually put Alphabet on top.

First, Gemini now has over 650 million monthly active users, up from about 400 million just six months earlier. This rapid rise shows Alphabet’s advantage of offering Gemini in everything from high-end Android phones to its popular Google Workspace apps.

The second big move is a recent collaboration with Apple, in which Gemini will become the underlying AI model for the next iteration of Siri. This is a big win for Alphabet (and an admission of failure of sorts for Apple), which means potentially millions more people will soon be tapping into Gemini for their AI chatbot needs. Apple will reportedly pay Alphabet about $1 billion annually to use Gemini on its devices.

All of this is on top of Alphabet’s already impressive growth, in which the company’s sales increased 16% to $102 billion in the third quarter (which ended Sept. 30), and non-GAAP earnings per share rose 35% to $2.87. With Gemini gaining ground, the company collaborating with Apple for even more Gemini expansion, and Alphabet’s sales and earnings already increasing rapidly, Alphabet and its shareholders likely have more to look forward to.

Alphabet Stock Quote

Today’s Change

(1.05%) $3.45

Current Price

$331.83

Key Data Points

Market Cap

$4.0T

Day’s Range

$329.78 – $335.20

52wk Range

$142.66 – $341.20

Volume

486K

Avg Vol

23M

Gross Margin

59.18%

Dividend Yield

0.25%

3. Taiwan Semiconductor’s processor manufacturing is unparalleled

Taiwan Semiconductor (TSM +1.36%), also known as TSMC, is the world’s leading AI semiconductor manufacturer, with an estimated 90% market share for advanced processors. This means that when Nvidia or other tech companies need AI processors, they’re almost certainly made by TSMC.

The company recently reported its first-quarter results (ended Dec. 31), in which sales rose by nearly 26% to $33.7 billion and diluted earnings increased 35% to $3.14 per American depositary receipt (ADR).

Taiwan Semiconductor Manufacturing Stock Quote

Taiwan Semiconductor Manufacturing

Today’s Change

(1.36%) $4.43

Current Price

$330.56

Key Data Points

Market Cap

$1.7T

Day’s Range

$328.79 – $335.02

52wk Range

$134.25 – $351.33

Volume

424K

Avg Vol

13M

Gross Margin

59.02%

Dividend Yield

0.94%

Like Micron, TSMC is benefiting from a surge of AI spending that could last for years. Nvidia’s management believes AI infrastructure will reach up to $4 trillion by the end of the decade, which will help drive advanced processor manufacturing for TSMC for years.

While no tech stock is foolproof, these three companies have reached leading positions in AI that should benefit their shareholders for many years to come.