Inflation tends to place pressure on the S&P 500. With falling demand amid higher prices, investors tend to show less tolerance toward the higher valuations that drive many stocks.

But there are some companies that can actually benefit from inflation. Investors looking for stocks that can thrive under such conditions should consider Amazon (AMZN 3.43%), ExxonMobil (XOM -2.78%), and Roku (ROKU -10.29%). Let's take a closer look at these three inflation-resistant stocks and see if they are a buy right now.

Shopper reacts in surprise to the prices printed on a long receipt.

Image source: Getty Images.

1. Amazon

Even in an inflationary environment, Amazon can benefit from considerable tailwinds. It has long been a generalized retailer, selling items that fit any budget. This includes choices for higher-income customers less affected by rising prices and low-cost items that can help it compete with an ultra-discounter like Dollar Tree.

Additionally, Amazon pioneered the fast-growing cloud computing industry. Grand View Research forecasts a compound annual growth rate (CAGR) of 16% through 2030 for this sector. Since this technology tends to lower costs for companies, rising prices could speed up such adoption.

The company generated $470 billion in revenue in 2021, 22% more than in 2020, and it increased net income by 57% to $33.4 billion during this period. Valuation adjustments in equity securities more than made up for rising costs.

Admittedly, Amazon forecast single-digit revenue growth for the first quarter, and some even fear it will have its largest quarterly loss in history. This may explain why the stock only rose by 5% over the last year.

Nonetheless, the loss is unrelated to its core businesses, and analysts expect double-digit revenue growth to continue on an annual basis. Moreover, since its price-to-equity ratio of 50 places its valuation near multi-year lows, investors might have a unique opportunity to buy Amazon stock at a discount.

2. ExxonMobil

Rising oil prices have helped reverse the fortunes of ExxonMobil. Despite the rising popularity of electric vehicles, oil and gas accounted for 69% of U.S. energy use in 2020, according to the Energy Information Administration. Hence, investors should not expect the demand for such fuels to disappear, with or without inflation.

Moreover, the livelihood of most Americans depends on the need to power homes and cars, ensuring that most consumers will buy energy almost without regard to the cost. Furthermore, since ExxonMobil is a diversified energy company, it will benefit from the production, transport, and marketing of oil, gas, and chemicals. Such businesses help to keep the company stable in nearly every economic environment.

These segments also generated $286 billion in revenue for the company in 2021. Consequently, it earned $23 billion in net income during that period and covered almost $15 billion in dividend costs. That payout, now at $3.52 per share, has risen for 39 consecutive years. Additionally, its cash yield of 4.3% is more than triple the 1.4% returned by the S&P 500.

Also, thanks to the ongoing recovery from the worst parts of the COVID-19 pandemic, the stock price has risen 46% over the last 12 months. At a 15 P/E ratio, it remains cheaper than archrival Chevron, which sells for 20 times earnings. Such a multiple gives stockholders a compelling inflation hedge at a low price.

3. Roku

Rising prices will probably boost demand for low-cost entertainment, a need that Roku is well-positioned to fill. It's an aggregator of streaming channels, many of which it makes available at no cost to the user. And with the prevalence of the company's low-cost Roku TVs and streaming players, consumers have increasingly chosen Roku over the platforms of competitors such as Alphabet or Samsung.

However, at its core, it has become an advertising platform. As televised media switches to streaming, Roku provides both an ecosystem and a user base that can help advertisers reach their desired audiences. Demand for such a platform should grow as Mordor Intelligence estimates an industry CAGR of 14% through 2026.

With Roku's revenue growth far exceeding that pace, inflation will likely not stop this stock. The company reported $2.8 billion in revenue in 2021, up 56% year over year. This growth turned the company profitable as it reported 2021 net income of $242 million. And even though Roku predicts revenue growth will slow to 25% in the first quarter, that still keeps it ahead of inflation.

Additionally, the market seems to have priced in this slowdown. The tech sell-off hurt the entertainment stock as it has fallen by nearly two-thirds over the last 12 months. Still, Roku's price-to-sales ratio has fallen to a multiyear low of 6. This looks like a bargain for a stock that can drive colossal growth regardless of how long inflation remains an issue for consumers.