For some investors, now may not seem like the right time to buy a tech stock. After all, some experts are pointing to problems within the U.S. economy that indicate a recession may be looming. But even if a recession is around the corner, that doesn't mean that there aren't great technology companies worth investing in now, and holding for the long term.

Three perfect examples are PayPal Holdings (PYPL -3.20%), Square (SQ -0.64%), and Amazon (AMZN -0.40%). Here's why. 

Orange lines on a dark motherboard background.

Image source: Getty Images.

PayPal

PayPal is one of the largest payment processing companies and has been a leading player for years. But there's likely more room for PayPal to grow, based on the size of the global financial tech market, which will be worth $306 billion by 2023.

PayPal has about 286 million active users, up 17% year over year, and is continually looking for new ways to expand its reach. One such opportunity comes from its popular Venmo app, which allows users to easily pay each other electronically. Venmo's payment volume increased 70% in the most recent quarter, and the company is on track to surpass $100 billion in Venmo TPV (total payment volume) by the end of this year. 

If all of that weren't enough to spur PayPal's growth, the company recently bought a 70% stake in GoPay, a China-based online payment services company. The purchase was significant; it means that PayPal is one of the only foreign companies that's been given a license to operate as an online payment provider in China. This market is especially sought-after because the amount of online transactions in the country last year totaled about $200 trillion.

PayPal's user growth, opportunities with its Venmo app, and recent move into China all signal that this payment processing giant is on the right track to benefit from the expanding online payment market. 

Square 

Square is a payment processing company, just like PayPal. If you're wondering why two companies in the same market deserve to be on this list, it's because there's a significant shift happening from physical cash to digital payments. As smartphone ownership has spread across the globe, digital payment processors are taking business away from traditional banks and could grab $280 billion worth of payments by 2025.

Square's business has been rapidly growing; the most recent quarter, the company's gross payment volume (GPV) -- the total dollar amount spent using Square's platform -- jumped 25% year over year. The company's growth has been fueled in part from Square attracting larger businesses to its platform. For example, the percentage of GPV that came from large sellers was 50% in the second quarter of 2018 but rose to 54% in the second quarter of 2019.

Aside from that growth, Square also has a huge opportunity by moving further into the lending business. The company has applied for a license that would allow it to provide business loans directly. The company currently relies on a third-party lender, but if it gets this license, it will able to lend money on its own and help round out the company's growing financial tech business.

Amazon

And last, but certainly not least, is Amazon. Why does this e-commerce giant deserve a spot on a top tech stock list? For one, the company uses machine learning, a type of artificial intelligence, to help decide where to place products on its web pages and to forecast which products will be the most in-demand. 

Additionally, the e-commerce giant is the leading public cloud computing company with 32% of the market. Its Amazon Web Services (AWS) is a more popular cloud platform than offerings by both Google and Microsoft, and AWS is the company's biggest profit generator. What's important about Amazon's cloud computing position is that this market is still growing quickly and will likely be worth $331 billion by 2022. 

Additionally, Amazon has made itself a key player in the Internet of Things space with its Echo devices and Alexa smart assistant. The company now has a slew of connected home speakers that easily pair with other smart-home devices and services that are helping it tap into the smart-home market, which will be worth about $42 billion by 2023.

Keep a long-term view

No one can predict how these tech stocks will perform in the coming years, but investors should remember to take a long-term approach with these investments. Each one of them has already built out a strong position in its respective market, and if they continue on the path they've started, then it's likely they'll continue to be great investments for those with a buy-and-hold investment strategy.