The benefits of compound interest come from holding investments for the long run. $1,000 compounding at 9% a year (which is around the long-term market average) for 10 years turns into just over $2,367. Not bad. But that same $1,000 compounding at 9% a year for 40 years turns into $31,409, showing the benefits of compounding money over decades.

The best way to make sure compounding does the work for you is to buy and hold quality businesses. Three stocks that you can buy and hold forever are Alphabet (GOOG -2.67%), Boston Omaha (BOC 2.20%), and Constellation Software (CNSWF -1.15%). Here's why.

A family running in a field looking at the sunset.

Image source: Getty Images.

1. Alphabet (Google)

Alphabet, the holding company that owns Google, has a portfolio of durable businesses with little competition. Google Search, its flagship product, has minimal competition outside of Microsoft's Bing and DuckDuckGo, which has less than 1% of the worldwide market share. It also owns the mobile operating system Android, which dominates smartphones outside Apple's iPhone ecosystem. Google Maps, YouTube, and Google Cloud are some of the other assets Alphabet owns. 

In the second quarter, Google's revenue grew 62% year over year to $61.9 billion, with operating income increasing to $19.36 billion. YouTube was the star of Q2, with revenue growing 84% year over year to $7 billion in the period. The quick-growth nature of Google's business is great, but investors should be confident in holding this stock for the long term because of how important Google's services are to people's lives. Search, Maps, and YouTube are indispensable to billions of people around the globe, and likely will be two or three decades from now. This makes the profits Alphabet generates highly predictable. 

2. Boston Omaha

Boston Omaha is a lot smaller than Alphabet, with a market cap below $1 billion. The reason investors can hold this stock forever is simple: The company has great leadership with a long-term time horizon. Co-CEOs Adam Peterson and Alex Rozek started Boston Omaha in 2015 with the broad goal of growing intrinsic value per share. So far, that has meant buying whole or partial stakes in durable businesses that generate steady streams of cash. 

Currently, Boston Omaha owns billboard advertising assets, a rural broadband business, a surety insurance operation, and a bunch of minority stakes in other businesses. The biggest outside investment is in Dream Finders Homes, a publicly traded home builder that Boston Omaha invested in a few years back. The company's stake is currently valued at over $100 million.

Boston Omaha's most recent investment is the Yellowstone Acquisition Company, a special purpose acquisition corporation (SPAC) that is taking Sky Harbor Group (SHG) public. Boston Omaha is also separately investing $55 million into SHG. SHG builds and leases aviation hangars for private jet owners looking to build out hangars around the United States. The company is still in the early stages, but aviation hangars are long-lived assets with durable demand from the ultrawealthy, making it a great addition to the Boston Omaha portfolio.

3. Constellation Software

Constellation Software is similar in a sense to Boston Omaha in that it is a holding company, but it has a more specific focus for acquisitions. Constellation is focused on buying vertical market software (VMS) businesses and then taking the cash they generate each year to buy more of them. That's a pretty simple strategy. It started in 1995 with $25 million from investors and founder/CEO Mark Leonard and has since grown to become a software powerhouse. In Q2, Constellation did $1.25 billion in consolidated revenue and $145 million in free cash flow.

Constellation has ridden the software wave, but this winter it said it was expanding its acquisition targets, setting the business up for further sustainable growth.

In a February 2021 letter to shareholders, Leonard said Constellation would be expanding to acquiring large software businesses (it historically focused on small and medium-sized ones) in order to expand its potential acquisitions pool and allow the company to put all the cash it has to work. He also wrote that Constellation is trying to "develop a new circle of competence."

It is unclear what this new strategy will be, but with the track record Constellation has put up, investors should have high confidence Leonard and the team can continue to create shareholder value over the long term.