Tech stocks are rising fast in 2023, with the Nasdaq-100 Technology Sector index up 46% since Jan. 1. High-growth markets such as artificial intelligence (AI) have made Wall Street bullish, with now an excellent time to consider expanding your tech holdings before it's too late.

Microsoft (MSFT 1.01%) and Advanced Micro Devices (AMD -0.89%) are two attractive options, as the companies are investing heavily in AI. Microsoft is home to the world's second-largest cloud platform, Azure, giving it an edge in the industry. Meanwhile, AMD has put all its efforts toward producing powerful AI hardware and appears to be close to matching Nvidia.

So, let's take a look at whether Microsoft or AMD is currently the better buy.  

Microsoft: A quickly expanding cloud business

Microsoft has turned many heads this year after investors realized its lucrative connection with ChatGPT developer OpenAI. The company has been the primary investor in the start-up since 2019, granting it exclusive licenses to several AI models. Microsoft has used OpenAI's technology to massively expand its business and attract new clients to its cloud platform Azure.

According to CEO Satya Nadella, in fiscal 2023, "Microsoft Cloud surpassed $110 billion in annual revenue, up 27% in constant currency, with Azure ... accounting for more than 50% of the total for the first time." The achievement is a promising step for Azure as it works to expand its market share.

In fact, Nadella also revealed that Azure Arc customers grew by 150% in 2023, including companies like Carnival and Domino's. And Azure OpenAI now serves over 11,000 organizations, with Ikea and Volvo joining the service.

Moreover, the platform's success is allowing Microsoft to bring AI to the average consumer. Azure has partnered with Mercedes to include ChatGPT in over 900,000 U.S. cars as a voice assistant as it grows the brand.

Microsoft's early investment in OpenAI has given it an edge over competitors like Amazon and Alphabet, which could take it far in the sector. 

Advanced Micro Devices: Catching Nvidia in AI chips

AMD has a long history of success in the chip market, with its central processing units (CPUs) consistently stealing market share from Intel since 2017. In fact, between the first quarter of 2017 to the fourth quarter of 2022, AMD's CPU share grew from 18% to 35%. Meanwhile, the same period saw Intel's share fall from 82% to 63%. AMD's success in the industry has come as it has offered consistent power at attractive pricing. 

However, AMD now faces a new challenge. It is striving to produce graphic processing units (GPUs) that can match the power of Nvidia's AI hardware and has so far made promising progress.

According to research from software firm MosaicML, AMD's previous generation GPUs achieved about 80% of the performance of Nvidia's. Meanwhile, MosaicML said software updates currently in development would likely boost AMD's chips enough to equal Nvidia's. 

Additionally, the study did not include AMD's recently unveiled GPU, the MI300, which is said to be the company's most powerful chip to date.

CEO Lisa Su revealed in the company's second-quarter 2023 earnings call that its AI chip expansion had bolstered customer engagement by about 7 times, driven in part by the MI300.

It remains to be seen what companies will sign on to utilize AMD's new GPU, but it could have a lucrative position in AI if it can offer performance and competitive pricing.  

Is Microsoft or AMD the better buy?

Microsoft and AMD are carving out solid positions in AI and across tech. Their stocks have consistently offered investors significant gains over the long term, making them compelling buys.

However, the companies' latest quarterly results indicate Microsoft is on better footing than AMD. In its latest quarter (Q4 2023), Microsoft's revenue increased by 8%, mainly driven by cloud earnings. Meanwhile, the same period (Q2 2023) saw AMD's revenue fall 18%, burdened by poor PC market conditions.

AMD has a strong outlook over the long term. But Microsoft's performance indicates it is the more reliable stock option for now.

AMD PE Ratio Chart.

Data by YCharts.

Furthermore, the chart above illustrates how Microsoft's price-to-earnings ratio is substantially lower than AMD's. The metric compares a company's earnings with its stock price and shows Microsoft is trading at a far better value than AMD. As a result, Microsoft is the better buy and an excellent way to invest in the booming AI market.