Tech stocks have enjoyed a rally this year after falling out of favor in 2022. The market appears to be in recovery mode after last year's macroeconomic headwinds led to reductions in consumer spending. As a result, many stocks are trending up, making now an excellent time to invest in some of the industry's leaders before their stocks climb any higher.

Advanced Micro Devices (AMD 3.40%) and Apple (AAPL -0.36%) are two attractive options, with one producing powerful chips for multiple companies and the other the king of consumer tech. AMD and Apple's stocks have soared 75% and 47% since the start of the year. However, a potential bull market suggests they could have more room to rise. Meanwhile, advances in technologies like artificial intelligence (AI) and virtual/augmented reality (VR/AR) could further bolster the companies. 

AMD and Apple are compelling investment options. However, before adding both to your portfolio, it's wise to get the most out of your investment by understanding which is currently the better buy. So, let's examine whether AMD or Apple's stock is the best option. 

Advanced Micro Devices

Chipmakers like AMD have become a favorite on Wall Street this year thanks to the endless potential of markets like AI and cloud computing. These industries require high-powered chips to develop, with AMD one of a handful of companies producing the necessary hardware. 

The company seemed to start 2023 at a disadvantage, with its biggest competitor, Nvidia, getting a head start in AI. However, the AI market is expected to expand at a compound annual growth rate (CAGR) of 37% through 2030, indicating there will be plenty of opportunities for AMD to snap up market share over the long term.

Meanwhile, many of Nvidia's clients are rooting for AMD as more competition means lower prices for AI chips. As a result, cloud giant Microsoft has stepped in to support AMD's AI chip expansion by providing financial and engineering resources with the aim of creating an alternative to Nvidia. The collaboration is promising, considering Microsoft holds exclusive licenses on multiple OpenAI models. The Windows company's guidance will likely prove invaluable to AMD. 

It will take time for AMD to catch up to Nvidia. However, it has a better chance than most with its successful chip business and massive support from other tech companies. 

Apple 

This year, Apple has become the first company to achieve a market capitalization of $3 trillion. The achievement highlights the stability of Apple's stock over the years, with its shares rising over 1,000% in the last decade.

The company's priority on quality products presented with an easy-to-use design language has created immense brand loyalty worldwide and allowed Apple to charge a premium for its devices. As a result, the tech giant's annual revenue has risen 48% since 2018, with operating income up 68%.

Meanwhile, Apple has achieved a leading market share in multiple areas, including smartphones, tablets, smartwatches, and headphones. In fact, the company holds the third-largest market share in e-commerce in the U.S., only behind Amazon and Walmart, despite offering a significantly smaller lineup of products.

Apple has reached unseen heights in its 47 years of business. However, it continues to have a solid outlook with a growing digital services business and its recently unveiled VR/AR headset, the Vision Pro. The VR market alone is projected to grow at a CAGR of 45% through 2030. With Apple's history of success when entering new industries, an investment in the company could be an investment in the future leader of the high-growth market. 

Is AMD or Apple the better buy?

AMD and Apple have enjoyed explosive growth over the last five and 10 years. They both hold crucial positions in tech and have the potential to profit substantially from the development of their respective industries. As a result, one of the best ways to determine the better buy is to assess which is currently trading at a better value. 

AMD P/E Ratio (Forward) Chart.

Data by YCharts.

Two useful metrics when working out a stock's value are the forward price-to-earnings ratio (P/E) and the price-to-free-cash-flow ratio. The chart above indicates Apple is the preferable stock on both fronts, with its lower forward P/E and price-to-free-cash-flow ratios indicating it offers more value than AMD.

Moreover, Apple's position as a leader in multiple markets makes it the more reliable company. AMD has its work cut out for it to catch up to Nvidia while also having to contend with competitors like Intel and Amazon, which are also developing AI chips. Apple has plenty of competitors. However, its years of dominance suggest it won't be dethroned from the top spot any time soon, making its stock the better buy right now.