After a stock market sell-off last year, the tech industry is on the rise in 2023, alongside innovative developments in consumer tech, artificial intelligence (AI), and more. As a result, the companies leading these sectors make increasingly attractive investments.

Since its founding almost 50 years ago, Apple (AAPL 0.64%) has conquered consumer tech by offering quality products across multiple markets. Its success in the industry has helped its stock climb over 1,000% in the last decade, granting investors consistent and reliable gains. 

Meanwhile, Nvidia (NVDA 3.65%) has captured Wall Street's attention by achieving an over 80% market share in consumer graphic processing units (GPUs) and using it to catapult itself to the top of the booming AI industry.

These companies likely have much to offer investors over the long term, thanks to their positions at the top of multiple lucrative markets. However, if you only have room for one in your portfolio, you'll need to know which is the better buy. So let's determine whether your money is better off with Apple or Nvidia's stock. 

Apple offers consistent gains and unrivaled brand loyalty

This month, Apple's stock surpassed its year-over-year record high price of $174, achieved in August 2022, by inching over $175. While a stock reaching such heights might suggest it's too expensive, Apple shares continue to be a buy thanks to their consistent and reliable growth. In the last five years alone, the company's stock has risen 276% despite having to contend with a global pandemic and an economic downturn.

Apple's reliability largely stems from the brand loyalty it has garnered from consumers over the years. Warren Buffett described the company's consumer devotion perfectly last month when he said, "If someone offered you $10,000 to never buy an iPhone again, you wouldn't take it." While surprising, the sentiment is true for millions of people who would happily switch brands of other products before abandoning their Apple devices.

The company's immense consumer loyalty has given it the power to rapidly grow public adoption of newer technologies. Markets like smartphones, tablets, Bluetooth headphones, and smartwatches each saw a massive spike in consumer adoption when Apple entered the picture, with the company now holding the largest market share in each of these sectors.

Apple's expected venture into virtual/augmented reality with a new headset later this year could make it the leader of this $31 billion market as well.

Nvidia enjoyed a monster rally in 2023 as it rides the AI wave

Nvidia's stock has skyrocketed 116% since Jan. 1, with bullish investors excited by the company's prospects in AI. The company has taken a top spot in the industry by becoming the primary supplier of GPUs to OpenAI's ChatGPT, an advanced chatbot capable of producing human-like dialogue. Considering ChatGPT was one of the main drivers of the current AI boom, Nvidia is well positioned to become the industry's go-to chip provider.

According to data from Grand View Research, the AI market is projected to develop at a compound annual growth rate of 37% through 2030, valued at about $137 billion last year. GPUs like Nvidia's are crucial to that growth, as the chips' power is required to run and develop AI software.

Moreover, a report from TrendForce in March revealed ChatGPT used about 20,000 GPUs in 2020, with that figure projected to hit 30,000 as it readies for commercialization. As more tech companies pivot their businesses to AI development, Nvidia has a massive advantage with its ability to sell its chips to the entire market. Competition from chipmakers AMD and Intel is growing, but Nvidia has so far built up a lead that will be difficult to beat.

Is Apple or Nvidia stock the better buy?

Apple and Nvidia have vast potential in their respective industries and will likely offer investors considerable gains in the coming years. However, choosing which company is the better buy lies in which is less of a risk and the more reliable choice. In this case, Apple stock is the better buy.

Nvidia has vast potential in AI, but its soaring stock price this year banking on the success of an untested market makes its stock the more volatile option. Meanwhile, Apple has proven time and time again its dominance in consumer tech and its ability to steal a leading market share in nearly any sector it enters. 

Moreover, Apple's forward price-to-earnings ratio of 30 compared to Nvidia's 70 makes the iPhone company a better value. So if you can only choose one, go with Apple's stock. However, Nvidia shares are still a compelling option if you're looking to invest in the burgeoning AI industry.