It isn’t just Microsoft. Apple and Amazon are both close to the $1 trillion mark again (they were last there in August) after rising 30 percent and 27 percent this year. Among the other tech giants, Netflix’s shares have gained more than 35 percent, and Facebook’s stock, the most battered among the big tech companies last year, has surged nearly 50 percent in 2019. Shares of Alphabet have been the laggard of the group, up just 21 percent this year. The six companies have now recovered all of the nearly $940 billion in value they lost over the final three months of 2018, and then some.

Underpinning the rally has been a shifting view of the investing landscape.

For years, investors, starved for returns, had piled into shares of big tech companies, pushing their value and the broader stock market up. That reversed sharply at the end of last year. As fears of a recession rose, investors in big tech faced a fundamental question: Could those companies keep adding users and generating more sales in a slowing global economy?

But since the start of the year, concerns have faded, and tech shares beckoned again.

The Federal Reserve has put a pause on interest rate increases, and China and the United States have moved slowly toward a trade agreement. That has tamped down recession fears and left investors believing that the American economy will continue to grow slowly and that interest rates will remain low for the foreseeable future.

Though earnings expectations have fallen, Wall Street still expects the tech giants’ profits to grow faster than the broader markets.

First-quarter results have so far supported that faith.

Microsoft reached its trillion-dollar mark a day after it reported a 19 percent jump in earnings from a year earlier, confirming that its transformation into a cloud computing leader continues unabated. The company beat almost every one of Wall Street’s performance expectations.