Tech stocks have been rising in 2023 as investors grow optimistic about the prospects of a new year. The Nasdaq-100 Technology Sector index has risen 20% since Jan. 1 -- a significant improvement after falling 40% throughout 2022. The sector has long been a great place to search for new portfolio additions, with some of these companies offering consistent gains over time.

As leaders in tech, Apple (AAPL 0.01%) and Amazon (AMZN 0.78%) make compelling buys, especially with the market showing signs of recovery. So let's take a look at which is currently the better buy: Apple or Amazon.

Apple

In an economically challenging 2022, Apple proved itself to be one of the most reliable and consistent stocks on the market. As seen in the table below, the iPhone company experienced a more moderate decline in its stock price over the year than many of its peers. 

Chart showing Apple's price falling less than the prices of several peers in 2022.

Data by YCharts

Alongside resilience under macroeconomic headwinds, Apple shares have risen 266% since 2018 and 819% since 2013.  The company's immense brand loyalty and walled garden of products have provided consistent, long-term growth. So it's not surprising that Wall Street mogul Warren Buffett has made Apple his biggest holding through Berkshire Hathaway, with the tech holding responsible for 41.3% of its portfolio.

In fact, Buffett saw Apple's stock decline last year as a buying opportunity. He increased his shares from 894.8 million to 915.6 million in the fourth quarter of 2022, and now owns a 5.8% stake in the company. And the move has already paid off as the tech giant's stock has risen 18% year to date.

For its fiscal 2023 third quarter, Apple reported disappointing results, with revenue declining 5.5% year over year to $117.2 billion, missing analysts' expectations by $4.5 billion. However, the company's reputation for growth has kept its stock rising. Investors have grown bullish over Apple's reported intention to venture into the virtual/augmented reality (VR/AR) markets later this year with the launch of a mixed-reality headset. 

Since the AR market is projected to see a compound annual growth rate (CAGR) of 40.9% through 2030, with the same metric at 15% for VR, Apple could see significant gains from the swiftly growing industry.

As a result, Apple's stock is a screaming buy based on reliability and its long-term outlook.

Amazon

Amazon's leading market share in cloud computing with Amazon Web Services (AWS) as well as e-commerce suggest its stock should be a no-brainer buy. However, economic declines over the past year have been detrimental to its business, with operating losses between its two e-commerce segments totaling $10.5 billion in fiscal 2022 and AWS earning 100% of its $12.2 billion in operating income.

Despite last year's declines, the e-commerce market was worth $9.09 trillion in 2019 and is projected to grow at a CAGR of 14.7% until at least 2027, according to Grand View Research. As a result, Amazon's 37.8% market share in the industry means it has a lot to gain as easing inflation boosts the market. However, the company's substantial operating losses in 2022 could mean it takes longer for the business to recover.

Moreover, Amazon's cloud computing business was its primary source of growth in 2022, with AWS revenue rising 29% year over year to $80 billion. Operating income increased 23% to $22.8 billion. Amazon's leading 34% market share in the $369 billion cloud market will likely take it far as the technology develops further.

When comparing forward price-to-earnings ratios, Apple's 26 against Amazon's 66 makes shares in the iPhone company a far better value. Meanwhile, Apple's free cash flow of $97.5 billion and Amazon's negative $16.9 billion suggest Apple is better equipped to overcome additional economic declines. 

Amazon's dominance in e-commerce and cloud computing makes it an excellent long-term investment. However, Apple's consistent growth despite macroeconomic headwinds and coming developments makes its stock the better, more reliable buy.