Many companies across the tech world are venturing into virtual reality, with the technology looking likely to become widely adopted in the near future. While virtual reality has primarily been connected with video games in the past, companies like Meta Platforms (META 0.14%) have shown that the technology can also be applied in professional settings, from healthcare to education.

According to Grand View Research, the virtual reality market was worth $21.83 billion in 2021 and will expand at a compound annual growth rate (CAGR) of 15% through 2030. As a result, it's not a bad idea to invest in the burgeoning market before the industry really takes off.

Here are two stocks you can buy to invest in virtual reality. 

1. Meta Platforms

Meta, previously known as Facebook, joined the virtual reality market in 2014 with its acquisition of Oculus. Over the past nine years, the company has captured a 90% market share in VR headsets, according to research firm IDC, primarily owed to the launch of the Meta Quest 2 in 2020. The Meta headset made virtual reality more accessible to the average person than ever before, with the device fully functional at $299.99. Comparable headsets at the time were priced closer to $1,000 and still needed other equipment like a gaming PC or console to be used.

Meta has extensive VR ambitions, with its focus now entirely on building infrastructure for its metaverse, akin to the internet but in virtual reality. 

While it will take time and massive investment, if all the company's hopes for the metaverse come to fruition, Meta could be the leader and founder of the next version of the internet. As a result, Meta's stock is a compelling choice for anyone looking to invest in the quickly expanding industry. 

Meta's stock is up 58% year to date, with investors growing bullish after 2022, when the company's stock sank 64%. Despite the swift rise, Meta shares are still considerably down from the all-time high price of $382 they reached in September 2021.Consequently, now could be the perfect time to invest in this virtual reality titan.

2. Apple

Various acquisitions and filed patents over the years have made it clear Apple (AAPL 0.51%) has plans to enter virtual reality in the future. However, numerous reports in recent months have all but confirmed the time is closer than ever, with the iPhone company expected to launch an augmented/virtual reality (AR/VR) headset in 2023. 

According to Bloomberg, the mixed-reality headset will be capable of switching between AR and VR features with an iPhone-like interface. Additionally, where Meta's goal with its most recent headset was to get virtual reality to the masses with a low entry point, Apple's coming device could cost close to $3,000 and will offer a new approach to virtual meetings. 

While the price is high, Apple will reportedly lower its cost with updated releases over the coming years. Analysts have speculated that the company's long-term goal is to replace the iPhone completely with a similar but slimmer version of the device. 

If reports are true, Apple's headset will be one of the first to have augmented reality capabilities, making its stock a great way to invest in both markets. The augmented reality market on its own was worth $25.33 billion in 2021 and will grow at a CAGR of 40.9% through 2030 (per Grand View Research). An investment in Apple could skyrocket alongside that growth.

Moreover, Apple's past success in entering new markets has seen it quickly obtain a significant market share in smartphones, tablets, Bluetooth headphones, and smart watches after the release of its custom-designed versions. As a result, the company has the experience and brand loyalty to triumph in nearly any new market.

An investment in Apple's stock could be an investment in the future leader of virtual and augmented reality, with now an excellent time to get in on the ground floor.