Alphabet (GOOG 1.16%) (GOOGL 1.09%) and Twilio (TWLO 2.75%) are both very important tech companies, but most people might only recognize the former even exists.

Alphabet, the parent company of Google, is the highly visible leader of multiple markets. Google is the world's top search engine, Gmail is the largest email platform, and Chrome is the most popular web browser. Android is also the leading mobile operating system, and YouTube is the world's largest streaming video platform with more than 2 billion logged-in monthly users.

Twilio's cloud-based platform operates behind the scenes by processing text messages, calls, and other communication services within mobile apps. Outsourcing those features to Twilio is generally cheaper, less time-consuming, and easier to scale than creating those features from scratch. Companies like Lyft, Airbnb, and MercadoLibre all use Twilio's services.

A man uses a smartphone.

Image source: Getty Images.

Alphabet's stock price rallied nearly 130% over the past three years as the growth of its core advertising business supported the expansion of its sprawling digital ecosystem. Yet Twilio's stock price skyrocketed over 720% as its streamlined communications tools locked in more mobile apps.

Twilio generated more explosive gains than Alphabet, but can it maintain that momentum and remain a better investment over the next few years? Let's take a fresh look at both companies and see if we can find an answer.

How fast is Alphabet growing?

Alphabet generated 80% of its revenue from Google's advertising business last year. Its ad growth decelerated in the first half of the year as the coronavirus pandemic spread, but it partly offset that slowdown with the growth of Google Cloud, which benefited from robust demand for cloud services throughout the crisis. Google's advertising business recovered in the second half of the year as more businesses reopened.

Alphabet's revenue rose 13% to $182.5 billion in 2020 as its net income increased 17% to $40.3 billion. Its full-year operating margin expanded, from 21% to 23%, as it reined in its spending.

In the first quarter of 2021, Alphabet's revenue rose another 34% year over year as its advertising business recovered against easy comparisons to the previous year. Google's total ad revenues increased 32% to $44.7 billion as Google Cloud's revenue grew 46% to $4.05 billion.

Its operating margin expanded again, from 19% to 30%, and its net income surged 162% to $17.9 billion. Wall Street expects its revenue and earnings to rise 30% and 51%, respectively, this year.

Alphabet's future looks bright, but there are still a few challenges ahead. It still faces regulatory challenges in several markets, tough competition in the advertising market from Facebook, Amazon, and other platforms; and it still trails far behind Amazon Web Services (AWS) and Microsoft Azure in the cloud infrastructure market. Apple's latest privacy changes to iOS could also affect its targeted ad sales.

How fast is Twilio growing?

Twilio's revenue rose 55% to $1.76 billion in 2020. It posted a full-year net expansion rate of 137%, which means its existing customers spent 37% more money on its services.

A person uses a smartphone.

Image source: Getty Images.

However, Twilio's net loss still widened from $307 million to $491 million. On a non-GAAP basis, which excludes its stock-based compensation and acquisition-related expenses, its net income rose 62% to $35.9 million.

Twilio will post its first-quarter earnings on Wednesday, May 5, and it previously guided for 44%-47% year-over-year revenue growth. Analysts expect its revenue to rise 39% for the full year, but for its non-GAAP earnings to dip into the red again as it ramps up its spending and faces three major challenges.

First, new A2P (application to person) fees from carriers, which are charged whenever an app accesses the SMS network, will weigh down Twilio's gross margins. Its growing dependence on acquisitions to boost its revenue could exacerbate that pressure.

Second, it still faces competition from similar platforms like Vonage's Nexmo, Bandwidth, and MessageBird. Those competitors could all make it tough for Twilio to raise its prices and offset the impacts of its A2P fees and inorganic growth strategies.

Lastly, Twilio relies heavily on big stock-based bonuses and secondary offerings to preserve its cash. As a result, its number of outstanding shares has increased by a whopping 70% over the past four years.

The valuations and verdict

Alphabet trades at 25 times forward earnings and less than seven times this year's sales -- which makes it a reasonably valued stock in the frothy tech sector. Twilio trades at 26 times this year's sales, making it a much more speculative stock, and the ongoing dilution of its shares could keep its valuations elevated.

If I had to choose one over the other, I'd pick Alphabet because its core business is more stable and its stock is cheaper. I still admire Twilio's business, but investors shouldn't pay the wrong price for the right company -- especially as higher bond yields potentially spark a rotation from growth to value stocks.