Technology stocks have been pummeled recently, especially those trading at rich valuations. Much of the impetus behind that downturn is soaring inflation. With prices rising faster than they have in decades, investors are worried about the near-term strength of the economy. But over the last 30 years, the S&P 500 Information Technology Index has generated a return of 3,600%, easily outpacing the 1,000% return of the broader S&P 500. That data makes a strong case for allocating a portion of your money to tech stocks.

For instance, Roku (ROKU -10.29%) and Twilio (TWLO 1.47%) are leaders in their respective industries, and you can buy both stocks at a bargain right now. Here's what you should know about these two unstoppable stocks.

Person reviewing a document while working at a laptop.

Image source: Getty Images.

1. Roku

Roku has become the gateway to streaming entertainment. In 2021, it once again ranked as the most popular connected TV (CTV) operating system in both the U.S. and Canada, and its platform accounted for an industry-leading 31.8% of global streaming time, up from 31.1% in the prior year. Amazon Fire TV ranked second, though its market share fell nearly three percentage points to 16.5%.

To reinforce its edge, Roku is spending aggressively on its own ad-supported streaming service, The Roku Channel. It debuted dozens of original titles last year, including its first feature-length film, and the company has more content in the works for 2022. So far, that strategy has been successful, as The Roku Channel ranked among the top five channels on its platform in the U.S. in third- and fourth-quarter 2021.

To monetize that success, Roku's demand-side platform (OneView) helps ad buyers create targeted campaigns across CTV, desktop, and mobile devices, both on and off Roku. And monetized video ad impressions nearly doubled in 2021. In turn, revenue surged 55% to $2.8 billion, and the company posted a GAAP profit of $1.71 per diluted share, up from a loss of $0.14 per diluted share in 2020.

Going forward, Roku has a long runway for growth. Traditional content providers (like cable and satellite) are expected to lose $26 billion in annual revenue by 2025 as more viewers turn to streaming content. As a result, CTV ad spend is set to hit $100 billion by 2030, according to BMO Capital Markets, and Roku's position as the most popular streaming platform should help it capture a good portion of that figure.

Why invest now? Roku's share price has fallen 76% from its high, and at 5.9 times sales, the stock is trading near a three-year low in terms of valuation.

2. Twilio

Nearly one-third of consumers will walk away from a company after one bad experience, according to PricewaterhouseCoopers. But businesses that keep people satisfied often benefit from strong brand loyalty, which inevitably leads to more revenue. That's why Twilio's cloud communications platform has become so popular. It's a suite of tools that help developers build engaging applications with features like voice, video, email, and messaging.

Businesses use those applications to deliver targeted marketing campaigns, build contact centers, and communicate with customers in a number of other ways, such as appointment reminders, delivery notifications, and password resets. Last year, the International Data Corp. once again named Twilio the communications platform as a service (CPaaS) industry leader, citing its "broad portfolio, reliability, and reputation for quality" as differentiating factors.

That recognition came alongside a solid financial performance. Twilio grew its clientele 16% to 256,000 active accounts in 2021, and the average customer spent 31% more, evidencing a successful land-and-expand growth strategy. In turn, revenue grew 61% to $2.8 billion, an acceleration from 55% growth in the prior year. On a less optimistic note, Twilio is still losing money on a GAAP basis, and it generated negative free cash flow of $148 million, due in part to expenses related to the $839 million buyout of toll-free messaging provider Zipwhip (and other smaller acquisitions).

However, as a Twilio shareholder myself, I'm not worried about the negative cash flow. The company has $5.4 billion in cash and short-term investments on its balance sheet, and with a $100 billion addressable market by 2023, it makes sense to grab as much market share as possible. Thus far, that strategy has kept Twilio in a leadership position. And with the stock price down 64% from its high, shares are trading at 8.9 times sales, well below their three-year average of 20.3 times sales. That's why this growth stock is a bargain buy.