Technology is the sector that has historically turned out monster winners for shareholders. Over the last 10 years, the tech-centric Nasdaq Composite has trounced the Dow Jones Industrial Average and S&P 500, rising 379% to the other indexes' returns of 178% and 239%, respectively.

With artificial intelligence (AI) projected to add trillions in value to the economy in the coming years, top tech stocks are a no-brainer investment. If you have some extra money you don't need for paying off debt or other expenses, the following tech stocks have the potential to grow your money for years to come.

Taiwan Semiconductor Manufacturing headquarters

Image source: Taiwan Semiconductor Manufacturing.

1. Taiwan Semiconductor Manufacturing

Major deals continue to be made for more chips and data center capacity, and much of the value of these deals ultimately flows to the leading chip manufacturer in the world, Taiwan Semiconductor Manufacturing (TSM 8.01%).

TSMC makes chips for all the leading semiconductor companies, putting it in control of over 70% of the foundry market, according to Counterpoint. Advanced chip technologies (e.g., 7-nanometer nodes and lower) accounted for about three-quarters of its revenue last quarter. Its total revenue surged 44% year over year in Q2.

Most of TSMC's $106 billion in trailing-12-month revenue is generated from wafer fabrication. The rest is earned through other services, such as testing, packaging, design, and royalty income. These services, combined with TSMC's ability to supply a massive amount of chips every year, give it a competitive advantage.

Its manufacturing efficiency also drives stellar margins. TSMC generated $45 billion in net income over the last year. Customers value TSMC for quality service and timely delivery of products. This is an important advantage for TSMC as big tech companies race to build the most advanced AI models to stay ahead of the competition.

Considering its importance in the chip supply chain, an investment in TSMC is a bet on the increasing competition in the AI market. Analysts expect the company's earnings per share to grow at an annualized rate of 21% in the coming years, yet investors can still buy the stock at just 26 times next year's earnings estimate.

The Google logo displayed on a phone.

Image source: Getty Images.

2. Alphabet (Google)

Investing in leading cloud stocks is another attractive opportunity in the tech sector. Cloud services are where companies are using AI to more intelligently use their data and build their own applications. This is fueling growing demand for Alphabet's (GOOG 3.08%) (GOOGL 3.26%) Google Cloud, which should benefit the stock over the long term.

While Google Cloud is third in market share behind Amazon and Microsoft, it is gaining ground in the cloud market. Google Cloud has a competitive advantage in offering proprietary generative AI models like Gemini and best-in-class AI infrastructure. Its revenue grew 32% year over year last quarter, nearly double that of Amazon Web Services.

Google Cloud has been developing its own chips and systems for AI over the last decade. Its Tensor Processing Units (TPUs) were designed specifically for AI and offer optimal power efficiency, which is increasingly important as training more advanced AI with massive chip clusters will require tremendous amounts of energy. Google also offers general-purpose chips from third parties to offer customers the greatest flexibility in compute performance, depending on their needs.

A competitive advantage for Alphabet is how it leverages its AI chips and proprietary models across multiple businesses. For example, Alphabet's Gemini AI models power all its consumer and enterprise services, including Search, Maps, and Cloud. It also uses its TPUs to power both cloud services and even its Pixel phone.

It can effectively spread the costs of its AI technology across more revenue, which, in turn, drives up profit margin. In the last quarter, its earnings per share grew 22% year over year, and analysts are projecting double-digit growth over the long term.

Assuming Alphabet's earnings grow consistent with Wall Street's expectations of 15% on an annualized basis, the stock should follow suit, as it still trades at a reasonable multiple of 23 times next year's earnings estimate.