Quantum computing has quickly become a hot trend among investors. Small start-ups have attracted lots of attention as they work toward lowering error rates on quantum computing processing and building transformational new computing systems that could impact everything from climate modeling and finance.
The market size is impressive as well. Boston Consulting Group estimates that hardware and software sales from quantum computing could reach up to $170 billion by 2040.
However, many quantum computing experts believe most of the potential breakthroughs are still years away. So, how can you invest in quantum computing now, without taking on too much risk? The smartest approach is to buy shares of companies that are already well diversified with other businesses, yet have some exposure to quantum computing. Here's why Amazon (AMZN -1.38%) and Microsoft (MSFT -0.64%) fit the description perfectly.

Image source: Getty Images.
1. Amazon
I know Amazon probably isn't the first company that comes to mind when you think of quantum computers, but the company is at the forefront of quantum computing services.
Amazon partners with quantum computing companies, such as IonQ and Rigetti, allowing developers and researchers to run quantum algorithms on Rigetti's superconducting systems and IonQ's hardware as an add-on service to Amazon Web Services (AWS).
The quantum computing-as-a-service market is still small but should continue to grow as the technology becomes more reliable and faster. Amazon is perfectly positioned to benefit because the company is the leading public cloud computing company, with 30% market share.
What's more, earlier this year, Amazon revealed a prototype quantum computing processor it developed, called Ocelot, which the company says will help reduce quantum computing errors and make processing more efficient. While it's not meant to be a big moneymaker for Amazon or used in wide-scale applications just yet, the processor shows that Amazon is focused on tapping into this market as it expands.
And finally, Amazon is well diversified, so even if quantum computing takes longer to become useful than expected, investors will still benefit from the company's e-commerce, cloud computing, and advertising opportunities.
2. Microsoft
Like Amazon, Microsoft's cloud computing position gives the company an important quantum computing edge. Microsoft's Azure cloud services continue to grow quickly, and it's gaining ground on AWS, with 21% of the cloud computing market right now.
Azure Quantum offers access to Rigetti, IonQ, Quantinuum, and other cutting-edge quantum computing companies, allowing Azure customers access to hardware and software created by the companies. Microsoft also took its significant step into quantum computing recently when it debuted its Majorana 1 processor.
The company says Majorana 1 is a topoconductor (topological superconductor) quantum computing processor that is "an entirely new state of matter" that is neither a solid, liquid, or gas. The company says the processor is controlled digitally and creates stable and fast qubits -- the processing unit of measurement for quantum computers -- and is a big step toward reaching 1 million qubit quantum computers. The company says all of this moves the timeline up for quantum computers solving intricate problems in the coming years, instead of decades.
Microsoft has had recent success diving into new tech trends, including its early investments in ChatGPT creator OpenAI, and its early moves into quantum computing indicate that the company is serious about leveraging its cloud ingenuity to benefit from the next stage of computing.
Still, the benefits of quantum computing for Microsoft are years away. This is why it's good that the company is experiencing significant growth from its cloud services, which increased revenue by 33% in the third quarter of 2025 (which ended March 31).
With the company's diversified software offerings and cloud services -- along with its early moves into quantum computing -- investors don't have to worry about Microsoft being too reliant on the nascent quantum computing market for future growth.