Tech stocks have been off to the races this year, and even the biggest of the big have been in on the party. This includes Alibaba (BABA 1.44%) and Google parent Alphabet (GOOGL -0.27%) (GOOG -0.28%), who sported gains of 32% and 15%, respectively, in 2020 to date -- compared to just 5.5% for the S&P 500.  

Both are trailing behind the returns for some of their peers, though, largely because each comes with its own imperfections: Alibaba caught in political crosshairs as the U.S. and China still duke it out over trade relations, and Alphabet because of weakness in its ad business from the pandemic and ongoing regulatory scrutiny at home and abroad. Nevertheless, in spite of the flaws, both tech platforms are worth a look.

Someone pictured in the background pressing an internet search bar in the foreground.

Image source: Getty Images.

Chinese e-commerce puts in the work on leg day

When the pandemic lockdown hit China early in 2020, there was no shortage of worry over the damage it would cause to the developing economy. But just as it did during the SARS outbreak in the early 2000s, e-commerce is doing some heavy lifting to keep things going.  

While not totally smooth sailing across its myriad online services, the company said that active buyers in June on and -- two of its oldest sites -- increased over 100% and 50%, respectively, from a year ago. And across the entire sprawling "core marketplace" segment, Alibaba boasted 874 million monthly active users in June 2020, up 28 million from the previous quarter.

Helped by its small but fast-expanding cloud computing segment (which grew 59% year over year and made up 8% of the revenue total), Alibaba's total revenue increased 34% from the year prior during the three months ended June 2020, to $21.8 billion.

And this isn't just a high-growth story anymore. Alibaba generated $6.74 billion in net income (or $5.18 billion in free cash flow) during the June-ended quarter. Whichever metric you use, shares trade for a value relative to its big tech peers considering the increasing importance of e-commerce in China and the potential the business overall still possesses. The stock trades with a trailing-12-month price-to-earnings ratio of 30.2 and at 27.1 times trailing-12-month free cash flow.  

Of course, while the U.S.-China trade war won't dent Alibaba's growth trajectory for now, as it still generates the lion's share of results on the other side of the Pacific, legislation passed in the U.S. earlier this year could wind up causing Alibaba stock to be delisted from American stock exchanges. That wouldn't be catastrophic, but would most certainly be messy for shareholders -- thus the relative value (compared to other tech titans) for a big business that's still growing at such a fast clip. 

Alphabet busy planting seeds for the future

Alphabet's political problems also abound, both at home and abroad. The company's search and advertising bread and butter has been undergoing an antitrust investigation by states and at the federal level. And Google has been fined on multiple occasions (for a total of some $9 billion) by the European Union for anti-competitive practices. Evolving consumer data collection regulations and a tough year for the online search-based ad business are also issues.

Given the heavy burden weighing on Google, it's amazing Alphabet's stock is up at all in 2020 -- let alone beating the market overall. But this is a powerful technologist that plays a key role in the lives of hundreds of millions of internet users every day. Alphabet's overall revenue fell 2% for the quarter ended in June -- with the ad business falling 8% from a year ago to $29.9 billion, offset by a 43% increase in Google Cloud to $3.01 billion and a 26% increase in "other" revenue (YouTube and Play app store purchases, hardware sales, etc.).  

Though advertising still wins or loses the day for now, that's changing fast as its Cloud and other various subscription services are on the rise. Also in the mix is the diverse "other bets" segment (potentially disruptive startups like Waymo, Verily, and Wing), which generated $148 million in revenue last quarter but ran up operating losses of $1.12 billion.

The Alphabet family can stomach the blow, though, and its search-based ad business will likely bounce back very quickly as the effects of COVID-19 slowly wane. Even with a less-than-perfect ad business and loss-generating startups, net income was $13.8 billion last quarter (or free cash flow of $8.60 billion). Based on trailing-12-month metrics, shares of Alphabet trade for 33.4 times earnings per share and 35.4 times free cash flow.  

There's also the balance sheet, which contains over $121 billion in cash and equivalents and only $4.02 billion in debt. Alibaba is also impressive, with $53.9 billion in cash and equivalents and only $17.1 billion in debt, but Alphabet has some of the deepest pockets on the planet. It deserves the premium price tag, despite its woes.

Nevertheless, given that e-commerce is the winning business trend right now, Alibaba's relative value makes it look like the more attractive purchase of the moment. There's the U.S.-China political risk that isn't going away anytime soon, but Alibaba will be just fine in the long term.