Alphabet (NASDAQ: GOOGL) (NASDAQ: GOOG) and Microsoft (NASDAQ: MSFT) are great stocks to anchor anyone's portfolio. These tech behemoths each generate tens of billions of dollars of free cash flow every year, and while they have long been large, well-known companies, their stock prices continue to deliver returns that make index fund investors jealous. Here's why investors can feel confident buying these stocks today and well into the future. Image source: Getty Images. Alphabet More than 2.9 billion users depended on Google services such as Gmail, Calendar, and Google Docs last year. And with billions of people using the Google search engine every day, Alphabet is positioned to keep reaping the rewards as more and more advertising spending shifts to digital platforms. Google shares what is essentially a duopoly in the global digital ad market with Facebook -- between them, they sop up around half of all digital ad spending. As more businesses turn to these channels to reach their consumers, digital ad spending is expected to increase from $378 billion in 2020 to $645 billion by 2024, according to Statista. YouTube will be a valuable asset for Google as it attempts to capitalize further on the trend, given that, for the period between Q4 2018 and Q4 2020, 70% of YouTube's advertising reached audiences that hadn't been reached by those brands' traditional TV ads, according to Nielsen's Total Ad Ratings. Advertising generates slightly more than 80% of Alphabet's total revenue. It is also a large player in the fast-growing cloud services market -- Google Cloud generates a small amount of revenue right now -- but advertising is the cash cow. Over the last year, Alphabet generated a whopping $58 billion in free cash flow. The growing business ended the second quarter with $136 billion in cash sitting on its balance sheet, and it is currently distributing some of that back to shareholders in the form of share repurchases. This should be a rewarding investment for many years. GOOG Total Return Level data by YCharts Microsoft Microsoft, too, is highly profitable and should deliver reliable growth for your nest egg. It has built a solid brand around its core software services, such as the Windows operating system and the Office productivity suite. It recently raised the price for its Microsoft 365 subscription service, which includes access to workplace staples like Word and Excel. When a company has the ability to gradually raise its prices over time without losing ground, that's a sign of a strong competitive advantage. While growth in digital ad spending is the fuel for Alphabet's economic engine, growth in data and mobile devices are key drivers for Microsoft's business. By 2030, 50 billion devices are expected to be online, and that just means more opportunities for data to be created and consumed. This should spell a long runway of growth for Microsoft's cloud services business, which is a solid No. 2 in market share behind Amazon. (Google Cloud is No. 3.) Across cloud services, Microsoft 365, and its Xbox Game Pass cloud gaming service, recurring revenue from subscriptions is a large part of what makes Microsoft is a great investment. One analyst estimates that 75% of Microsoft's revenue over the next year will come from subscriptions. Microsoft possesses all the traits of a sound investment. It has a stable base of recurring revenue and a strong brand, and its balance sheet is loaded with $130 billion in cash and equivalents. It also brought in $56 billion in free cash flow over the last year. The stock should deliver reliable returns for many years. 10 stocks we like better than MicrosoftWhen our award-winning analyst team has a stock tip, it can pay to listen. After all, the newsletter they have run for over a decade, Motley Fool Stock Advisor, has tripled the market.* They just revealed what they believe are the ten best stocks for investors to buy right now... and Microsoft wasn't one of them! That's right -- they think these 10 stocks are even better buys. See the 10 stocks *Stock Advisor returns as of September 17, 2021 John Mackey, CEO of Whole Foods Market, an Amazon subsidiary, is a member of The Motley Fool's board of directors. Suzanne Frey, an executive at Alphabet, is a member of The Motley Fool's board of directors. Teresa Kersten, an employee of LinkedIn, a Microsoft subsidiary, is a member of The Motley Fool's board of directors. Randi Zuckerberg, a former director of market development and spokeswoman for Facebook and sister to its CEO, Mark Zuckerberg, is a member of The Motley Fool's board of directors. John Ballard owns shares of Amazon and Microsoft. The Motley Fool owns shares of and recommends Alphabet (A shares), Alphabet (C shares), Amazon, Facebook, and Microsoft. The Motley Fool recommends the following options: long January 2022 $1,920 calls on Amazon and short January 2022 $1,940 calls on Amazon. The Motley Fool has a disclosure policy.Source