Inflation, which is soaring across the world and hit a 31-year high in the U.S. in October, is generating fierce headwinds for many tech companies.

However, certain tech companies will fare much better in this inflationary environment than others. To separate the winners from the losers, investors should understand exactly how inflation affects tech companies.

Piggy bank and basket on a scale with word tiles spelling out "inflation."

Image source: Getty Images.

Supply chain challenges and rising costs

The current bout of inflation stems from supply chain constraints (such as the ongoing chip shortage and logistics bottlenecks) and elevated consumer demand for a wide range of products. In the U.S., over a decade of fiscal stimulus amplified that effect by weakening the U.S. dollar.

All that pressure is causing component and labor costs to rise. Companies that don't have enough pricing power to pass those costs on to their customers will likely see their gross and operating margins shrink.

That's what happened to Roku (ROKU -0.55%), which saw the gross margins of its streaming hardware business turn negative over the past two quarters. However, Roku offset that contraction by expanding its higher-margin platform business, which is less exposed to inflation-related headwinds.

Higher interest rates and a reduction of future earnings

To combat inflation, many governments increase the interest rates their central banks charge. Higher interest rates attract more consumers and businesses to put more money in higher-yield bonds and savings accounts -- which temporarily cools off a country's economic growth and slows down the inflation rate. But higher interest rates can hurt growing tech companies in three ways.

First, they increase the costs of borrowing more money to expand a business. That's bad news for high-growth tech companies, which are burning cash with widening losses.

Second, it reduces the long-term estimates for a company's earnings and free cash flow (FCF) growth. That reduction, which can be calculated with the discounted FCF (DCF) model, hurts high-growth companies, which are valued based on their future FCF growth instead of their near-term profits.

Therefore, unprofitable tech companies that are trading at frothy valuations usually suffer the most as interest rates rise. That's why Twilio (TWLO -0.14%), a high-growth cloud communications company that has never turned a profit, lost nearly 20% of its value over the past month.

Lastly, higher interest rates turn bonds into safer investments for big institutional investors. Therefore, it's common to see a lot of money rotate from the tech sector into the bond market as yields rise.

Don't avoid all tech stocks, but be selective

All of those headwinds are causing investors to rotate out of tech stocks and toward financial, consumer staples, and industrial companies -- which often perform better in a stable economy with elevated interest rates.

It's tempting to follow that trend and avoid tech stocks altogether. However, there are still plenty of resilient tech companies that can withstand the inflationary pressure with their pricing power and stable cash flow growth.

One of those winners is Apple (AAPL 0.01%), which has the leverage to negotiate favorable prices with its suppliers. It can also easily raise its hardware prices to pass on its higher costs to its loyal consumers.

Other potential winners include cloud service giants like Salesforce (CRM -0.90%) and Adobe (ADBE 0.63%). Both companies lock in their customers with sticky subscriptions, and their "best in breed" services give them plenty of pricing power in their respective markets.

Companies won't stop using Salesforce's customer relationship management software simply because their other expenses are rising. Creative professionals also won't stop using Adobe's software anytime soon.

These headwinds will eventually pass

For now, investors should limit their exposure to tech companies that don't have enough pricing power, lack consistent profits, and trade at high valuations. However, they should still stick with the stronger stalwarts and remember that these inflationary headwinds will eventually pass.