Tech giant Microsoft reported better-than-expected quarterly earnings after the bell Wednesday, and on Thursday the shares jumped by 5%, catapulting the company to $1 trillion in market value. Its current share price is hovering around $129.

If you had invested in Microsoft 10 years ago, that decision would have paid off. According to CNBC calculations, a $1,000 investment made on April 25, 2009, would be worth nearly $8,000 as of midday April 25, 2019, for a total return of almost 700%.

Over the same period, the S&P 500 returned just over 300%.

And Microsoft's stock is trending up: It ended Thursday with a gain of more than 3% after earlier in the day briefly surging 5% to a $1 trillion market cap. Revenue climbed 14% to $30.6 billion, beating the $29.84 billion estimate.

While Microsoft's stock has mostly done well over the years, any individual stock can over- or underperform and past returns do not predict future results.

CNBC: Microsoft stock as of April 25, 2019.

Some analysts believe Microsoft's growth is being driven by its transition to its cloud computing services — which use remote servers hosted online, as opposed to personal, physical ones — to store and manage data. The company's cloud business grew 41% in its most recent quarter to $9.6 billion.

It's also placing an emphasis on transitioning users from traditional productivity products, like Word and Excel, to the cloud-based Office 365 suite. Commercial sales of Office 365 increased 30%.