Amazon (AMZN -1.61%) has delivered huge returns for investors in years past and has done so again in 2023. Shares of the e-commerce and cloud services giant have skyrocketed more than 80% this year.

Some believe that Amazon could keep its impressive momentum going, but others think investors are better off avoiding the stock. Should you buy Amazon stock in 2024?

What Wall Street thinks

Of the 47 analysts surveyed by LSEG in December who cover Amazon, 43 recommend the stock as a buy or a strong buy. Three analysts rate Amazon as a hold, while one outlier thinks the stock will underperform.

However, Wall Street doesn't expect Amazon will deliver tremendous gains in the new year. The average analyst's 12-month price target reflects an upside potential of less than 5%.

There are some notable exceptions, though. Bernstein analyst Mark Shmulik named Amazon as his best idea for 2024. He expects the stock to jump 14% over the next 12 months. And that's just the start. Shmulik said that Amazon should have "quality, long-term growth."

He's not alone. TD Cowen's John Blackledge chose Amazon as his top large-cap internet stock for 2024. Blackledge set a price target that's 30% higher than Amazon's current share price. He likes the company's improving margins and the growth prospects for Amazon Web Services (AWS).

Why the bulls are right about Amazon

I think the bulls on Wall Street are right about Amazon. Although I'm unsure if the stock will soar 30% in the new year as TD Cowen projects, I'm upbeat about Amazon's chances of delivering market-beating returns.

One reason behind my optimism is the surprising strength of the U.S. economy. Inflation appears to be moderating and U.S. gross domestic product (GDP) remains strong. The Federal Reserve has signaled that interest rates could be headed lower in 2024.

All of this works in Amazon's favor. When consumers are confident about their financial futures, they tend to spend more.

I also expect Amazon's advertising revenue to continue to grow by leaps and bounds. The company's move to include limited ads on Prime Video in the new year is a smart move. Its use of machine learning to show the most relevant ads to customers should also boost profitability.

Speaking of boosting profitability, that's exactly what Amazon is doing overall. The company's earnings in the third quarter of 2023 increased by more than three times, versus the prior-year period. Amazon's laser focus on its bottom line is paying off nicely.

I fully agree with TD Cowen's Blackledge that AWS stands to benefit as organizations shift their IT spending to the cloud. He's also correct, in my opinion, that generative AI will provide a solid long-term tailwind for Amazon's cloud unit. While I don't expect the same level of fireworks surrounding generative AI we've seen this year, it should still be a key growth driver in 2024 and beyond.

But what about the stock's valuation?

The perennial concern about Amazon is its valuation. After the huge gains in 2023, the stock trades at nearly 40 times expected earnings. That's a higher level than any of the other FAANG stocks. However, there are a few key things to keep in mind.

First, Amazon's market dominance warrants a premium valuation, to some extent. The company has built impressive moats that make it one of the strongest businesses around.

Second, Amazon has historically channeled so much of its money into initiatives that fuel future growth. This makes earnings-based valuation metrics less applicable to the stock.

Third (and most importantly), Amazon's growth prospects are significant. For example, CEO Andy Jassy predicts that global IT spending in the cloud will soar by nine times or more over the next 10 to 15 years.

AWS should be a big beneficiary of this trend if he's right. A forward price-to-earnings ratio that only looks at where earnings might be one year in the future won't fully reflect this growth potential.

I think that Amazon's current valuation is quite reasonable, all things considered. Accordingly, I view the stock as a great pick for 2024.