After soaring to 9.1% in June 2022, the inflation rate eased to a still-high 6.4% this past January. This steep rise in the cost of living has led to a challenging year for all kinds of industries, including e-commerce and entertainment, as consumers tightened their budgets.  

As a result, Amazon (AMZN 3.53%) and Walt Disney (DIS -0.30%) shares both plunged over 40% in 2022. While they have gradually begun recovering since Jan. 1, Amazon is still down 35% year over year while Disney is down 28%.

Despite recent headwinds, both companies have excellent long-term outlooks, making this recent tumble a compelling investment opportunity. But is one of them a better buy? Let's take a closer look.  

Amazon 

Amazon is best known to consumers for its e-commerce offerings, having started out in 1994 as an online book retailer. The company boasts a 37.8% market share in the sector, a massive lead over Walmart's 6.3%. This dominating position in online retail actually damaged the company last year amid macroeconomic declines, with its e-commerce segments reporting operation losses of $10.6 billion in fiscal 2022. 

However, Amazon is gradually making digital services the primary focus of its business, which is great news thanks to the attractive profit margins that come with them. For instance, major competitor Apple has similarly increased its position in online services, with its corresponding segment reporting a 71.7% profit margin in fiscal 2022 compared to products' profit margin of 36.3%. The digital business enjoyed a revenue rise of 14% year over year.

Amazon looks likely to similarly profit thanks to online offerings, such as Prime Video, Audible, Kindle, Amazon Music, Twitch, and Game Studios, with many available through a Prime subscription. Digital services are a lucrative business model as companies can pay to produce a piece of content once and then sell it millions of times over, drastically reducing operating costs. 

Adding to its expansion into digital services, Amazon is significantly profiting from its cloud-computing platform Amazon Web Services (AWS). Revenue from the service increased by 28.8% to $80.1 billion in 2022. Meanwhile, operating income rose 23% to $22.8 billion.

Amazon's e-commerce business suffered in 2022. However, its larger focus on online services will likely provide a lucrative future over the long term. 

Disney

After many years as the entertainment king, the Walt Disney Company reached an amazing milestone -- a century in business -- in 2023. However, the company has face severe challenges recently, first from the COVID-19 pandemic, which demolished revenue from theme parks and box office sales in 2020 and 2021. Then, in 2022, a looming recession made expanding in the streaming market costly.

As a result, Disney's stock has declined 4% over the last five years (despite rising 78% over the last decade). While five-year stock growth is often a good metric for assessing a company's current investment potential, unavoidable challenges in Disney's case mean its stock performance since 2018 are unlikely to be replicated over the next five years. 

Moreover, Disney's streaming business pushed its content spending close to $30 billion in 2022, leading to operating losses of $10 million in its media and entertainment segment. However, a strong return to park guests and theater audiences should decrease the losses in the future while Disney works toward getting Disney+ to profitability. 

In 2023's first quarter, parks revenue increased 20.8% year over year to $8.7 billion, and operating income climbed 24.6% to $3.05 billion. The solid return of park guests meant Disney remained profitable despite media and entertainment losses.

Meanwhile, a smash hit at the box office in recent months with Avatar: The Way of Water could offer the company's current quarter a significant boost after hitting $2.24 billion and becoming the third highest-grossing film of all time worldwide. 

Disney and Amazon's shares both took multiple hits last year amid economic challenges. However, they remain excellent options to buy now and hold indefinitely, with their businesses likely to offer consistent growth over the long term.

Looking at these stocks' forward price-to-earnings (P/E) ratios, Disney's 24.1 compared to Amazon's 64.8 suggests the House of Mouse is currently trading at a better value. Additionally, Disney's $94 million in free cash flow against Amazon's negative $16.9 billion makes its stock feel more secure. As a result, if you're buying today, Disney's stock is the better buy, with Amazon also a great option if you're willing to forgo some value.