Amazon (AMZN 3.43%) has become a favorite on Wall Street in 2023 as improvements in its e-commerce business and an expansion into artificial intelligence (AI) have sent its shares soaring 73% since Jan. 1. The company has made an impressive turnaround this year after posting significant profit losses in its retail segments in 2022.

Amazon is clearly back on a growth path. However, the tech giant still has a long way to go before fully recovering from 2022's economic downturn. Despite solid gains in its quarterly earnings this year, its price-to-earnings ratio (P/E) hovers around 75. The high figure indicates its stock is relatively expensive, with better and cheaper stocks available to invest in e-commerce, cloud computing, and AI.

So ignore Amazon for now. Here are two alternative stocks that could be long-term winners.

Apple: The king of consumer tech despite recent declines

Apple (AAPL -0.35%) hasn't had the easiest year, with its revenue tumbling 3% in fiscal 2023 ended Sept. 30. The company has suffered from market-wide declines, which have caused significant reductions in consumer spending and sales declines across Apple's four product segments. Yet the company remains the biggest name in consumer tech, and is likely to see consistent growth over the long term from the immense brand loyalty it has achieved with shoppers.

The tech giant holds leading market shares in most of its product categories, including smartphones, tablets, smartwatches, and headphones. Apple's success with its devices over the years has seen it attain the third-largest U.S. market share in e-commerce after Amazon and Walmart despite offering a significantly smaller range of products. The company might not have the dominance in online retail that Amazon does, but it's well-positioned to see big gains as the market recovers and develops in the coming years.

Meanwhile, the iPhone company is gradually expanding its position in e-commerce by venturing into fintech. Apple has so far launched its own credit card, savings account, and a buy now, pay later program, which broadens its reach and makes its products accessible to a more diverse range of consumers.

In addition to e-commerce, Apple is prioritizing its role in digital markets that are less vulnerable to economic declines. The company's second-highest-earning segment is services, which include income from the App Store and subscription-based platforms like Apple TV+, Music, and iCloud. Services hit revenue growth of 9% year over year in fiscal 2023, outperforming all of Apple's other segments. Meanwhile, the company is heavily investing in AI, which could unlock more earning opportunities throughout the next decade.

Despite recent hurdles, Apple hit free cash flow of close to $100 billion this year, compared with just $17 billion for Amazon. With a P/E of 31, Apple is a much more reliable and stable way to invest in tech, e-commerce, and AI over the long term.

Alphabet: A more reliable AI investment

Alphabet (GOOG 9.96%) (GOOGL 10.22%) and Amazon have been compared a lot this year, with both companies active in cloud computing and AI. Amazon has slightly overshadowed Alphabet with its leading market share in cloud services and rapidly expanding library of AI tools on Amazon Web Services. However, as with Apple, it's hard to ignore how much cheaper Alphabet is with similar growth potential over the long term.

AMZN PE Ratio Chart

Data source: YCharts

The chart above shows how Alphabet is a much bigger bargain than Amazon, with its significantly lower P/E and price-to-free cash flow.

Alphabet is taking a slightly slower approach to AI than Amazon and has largely used this year to invest in its business and develop its technology. However, the company has plans to launch Gemini in the first quarter of 2024, a large language model that is the product of massive data sets and is expected to be highly competitive against OpenAI's GPT-4.

Moreover, Alphabet arguably has more earnings potential in AI than Amazon over the long term as the home of some of the world's most potent brands, including Google, Android, and YouTube. These platforms boast billions of users and have made Alphabet the biggest name in digital advertising. Alphabet's many popular services mean it has countless use cases for AI, from improving productivity tools to offering more pointed and efficient advertising, meeting the growing demand for AI cloud tools through Google Cloud, more accurate video recommendations on YouTube, and more.

Alphabet's stock has risen 153% since 2018, with Amazon's shares up 82% in the same period. The company is on a promising growth path that you won't want to miss out on, and is a much more attractive option than Amazon.