Last year was good for many tech stocks, reversing course from the significant losses many saw in 2022. The tech-heavy Nasdaq-100 led the major indexes with 55% total returns, its best year since 1999.

As optimism about the economy and the arrival of artificial intelligence (AI) into the mainstream picks up, investors are returning to tech stocks in hopes of capitalizing on emerging trends. How the market plays out is yet to be seen, but there's plenty of potential that makes the investments worth it. Here are three top tech stocks to buy to start 2024.

1. Taiwan Semiconductor Manufacturing

Taiwan Semiconductor Manufacturing (TSM 1.26%), or TSMC, is the largest semiconductor (chip) foundry in the world, with a 59% market share of the global semiconductor foundry market as of the third quarter of 2023, according to Counterpoint Research.

TSMC doesn't make chips that can be bought off the shelf like other consumer electronics. Instead, it makes chips specifically tailored to its clients' needs. Companies come to TSMC and essentially say, "Hey, we're building ABC and need a chip to XYZ."

TSMC's model has worked, helping it increase revenue by over 140% over the past five years and cross the $500 billion market cap threshold. Only 11 public companies globally are valued higher. Even still, TSMC's stock increased by 42% in 2023, and it's still fairly undervalued compared to other big tech companies.

NVDA PE Ratio (Forward) Chart

NVDA PE Ratio (Forward) data by YCharts

A slowdown in smartphone and PC sales (TSMC's biggest revenue drivers) over the past couple of years slowed TSMC's revenue growth, but the worst of that is predicted to be behind us. CEO C.C. Wei noted in the third-quarter earnings call that management saw early signs of "demand stabilization in the PC and smartphone end market."

A rebound in smartphone and PC sales coupled with the increased demand from AI-related technologies puts TSMC in a position to see a noticeable growth in the coming years.

2. AT&T

I'm sure I speak for many of AT&T's (T 1.02%) investors when I say the stock has been a huge disappointment for the past decade. In that span, its stock price is down 34%, far underperforming the S&P 500 and competitors like Verizon Communications and T-Mobile US.

T Chart

T data by YCharts

Despite its troubles over the past decade, AT&T seems to be turning the corner for the better. After a failed attempt at the media and entertainment industry, AT&T has returned to its core telecom businesses, focusing on wireless and fiber internet. Wireless business growth won't explode, but fiber is an area where AT&T can expand its business.

The main reason to invest in AT&T, however, remains its dividend, which is one of the highest dividend yields in the S&P 500. Its quarterly dividend is $0.28, with a trailing 12-month yield of around 6.5%. Although AT&T has a large amount of long-term debt, its free cash flow is more than enough to handle its debt and dividend obligations without investors fearing a reduction.

An attractive dividend should help investors remain patient while the company transitions back to its core businesses.

3. Alphabet

Google's parent company, Alphabet (GOOG 9.96%) (GOOGL 10.22%), hasn't seemed to receive as much media attention as its other big tech peers (especially relating to AI), but 2023 was a great year for the stock, which increased 58%.

My biggest concern with Alphabet has been how much it depends on Google advertising. Accounting for more than 77% of Alphabet's revenue in the third quarter of 2023, Google advertising is by far its most important business. However, other segments have picked up more of the slack recently, especially its cloud business and "other bets" segment that includes Waymo, DeepMind, and Verily.

Google Cloud -- which is third in market share behind Amazon Web Services (AWS) and Microsoft Azure -- gained 5% in market share since 2017 and now makes up 11% of Alphabet's revenue. There's still a steep climb to catch AWS and Azure, which have 32% and 22% market share, respectively, but it's encouraging to see the progress Google Cloud has made.

Alphabet recently released Gemini, its most powerful AI model and GPT-4 competitor, which should considerably improve the capabilities and appeal of Google Cloud. The global cloud computing market is projected to have a compound annual growth rate of 15% through 2028, widening the opportunities for all players involved. As Alphabet continues to innovate its cloud offerings, it should see a financial boost from the high-margin industry.

Despite its 2023 surge, Alphabet remains a great value, with a forward price-to-earnings ratio of around 20.5. This gives Alphabet a lot of upside for investors who have a long-term time frame.