It hasn't been easy to be an Amazon (AMZN -2.33%) investor in recent years, with its shares experiencing dramatic peaks and valleys almost annually. COVID-19 lockdowns sent its stock soaring in 2021 as its retail site became a shopping haven for homebound consumers. Then, an economic downturn in 2022 led Amazon's shares to plunge 50%, losing everything it had gained the year before.

However, the roller coaster appears to be over. Amazon's stock skyrocketed 81% in 2023 thanks to a return to profitability in its e-commerce business and growing potential in artificial intelligence (AI). Easing inflation and excitement over tech stocks have kept the market stable, with now an excellent time to consider investing in this retail giant.

Macroeconomic headwinds forced Amazon to introduce a range of cost-cutting measures that have put the company in better financial health than it's seen in years. Meanwhile, the company is profiting from solid positions in multiple high-growth markets.

So, here's why Amazon stock is a screaming buy this January.

The protection of a deep economic moat

An economic moat refers to a company's ability to maintain a competitive advantage over the long term, protecting its profits and market share from rivals. Amazon has excelled at this strategy, fortifying its business with brand loyalty, holding leading market shares in multiple industries, and reducing costs.

Amazon has become a household name worldwide thanks to the success of its online retail site. The tech giant dominates e-commerce in dozens of countries and is responsible for 38% of the U.S. market. For reference, the second-largest share is held by Walmart, with 6% of the sector.

The e-commerce industry is projected to hit over $3 trillion this year, growing at a compound annual rate of 8% through 2028. Meanwhile, Amazon is well positioned to profit significantly from the market's development, benefiting from consistent product sales and its popular Prime subscription.

However, the most lucrative part of its business has quickly become Amazon Web Services (AWS). The cloud service is responsible for over 62% of Amazon's operating income despite earning the lowest revenue out of its three segments. In the third quarter of 2023, AWS achieved nearly $7 billion in profits, representing growth of 29% year over year.

AWS holds a leading 32% market share in the cloud market, outperforming Microsoft's Azure and Alphabet's Google Cloud. Amazon's cloud business gives it a powerful role in one of the fastest-growing industries, with AWS gradually expanding its artificial intelligence (AI) offerings.

Over the last two years, Amazon has diligently reduced costs with moves such as closing dozens of warehouses, laying off thousands of employees, and shuttering unprofitable projects like Amazon Care. Restructuring has seen Amazon's free cash flow soar 427% to $16 billion since last January, illustrating it has the funds to continue expanding its economic moat and retain its dominance in its respective markets.

One of the biggest bargains among the "Magnificent Seven"

Originally a reference to the 1960 Western film and its 2016 reboot by the same name, the "Magnificent Seven" is a phrase used to describe the seven most powerful tech stocks. The seven include Nvidia, Microsoft, Tesla, Meta Platforms, Apple, Alphabet, and Amazon. These companies are leaders in their respective industries and are known for delivering consistent long-term gains.

As a result, shares in Amazon are only made more attractive, with the company potentially being the best bargain among the "Magnificent Seven."

NVDA PS Ratio Chart

Data by YCharts.

This chart compares the price-to-sales (P/S) ratios of the "Magnificent Seven." This is a useful metric for determining a stock's valuation, calculated by dividing a company's market capitalization by its trailing-12-month revenue.

In this case, Amazon boasts the lowest P/S ratio among the most prominent names in tech. Amazon is coming out of a stellar growth year, yet it has plenty of room to run thanks to the potential of e-commerce and cloud computing. As a result, Amazon's stock is a no-brainer and an excellent buy this month.