If you're like the average American, $5,000 is about what you bring home in a typical month, according to the U.S. Bureau of Labor Statistics. That may not sound like enough to be transformative, but through the magic of compounding it could pay off over the long term if you invest it well.

For example, earning the S&P 500's average gain of 9%, $5,000 invested for 10 years would more than double to $11,836. Over 20 years, it would become $28,022, and over 30 years, it would turn into more than $66,000. If you committed to investing that much money every year for a decade, you could set yourself up nicely for retirement.

On that note, here are two tech stocks that have the ability to generate even better returns over the long term.

A trader looking at a stock chart

Image source: Getty Images.

1. Okta

Cloud identity-specialist Okta (OKTA -1.56%) struggled like most of the tech sector in the last year, as demand for its software has slowed down. This was due to macroeconomic headwinds and as valuations in the software sector compressed.

However, there are a number of reasons why Okta, which offers software tools that help employees and customers do things like seamlessly and securely log in to the applications they need, still has a lot of growth potential left.

First, it's the leading independent provider of cloud identity software in the world. The company considers Microsoft to be its closest competitor and competes with other integrated software companies like Salesforce. But it's the top choice for organizations looking for a neutral option.

Second, the company is penetrating a large and growing addressable market, now valued at $80 billion, of which it controls just $2 billion. Cloud identity, which falls under the broader category of cybersecurity, is seen as a need, rather than a want.

This should help the company's growth, even in a difficult economic environment. Okta is also expected to launch its new privileged-access management product this year, which should give its growth a boost. Customers have been waiting for it to come out.

Okta is also responding to the current market environment by giving investors what they're demanding. The company has sharpened its focus on profitability and shown that it's capable of turning a profit. It has done so faster than analysts expected. 

In the fourth quarter, the company reported adjusted earnings per share of $0.30, up from an adjusted loss per share of $0.18 in the quarter a year ago. For the current year, the company sees adjusted profit per share of $0.74-$0.79.

Finally, the company just gained its FedRAMP High Authorization, making it easier for Okta to sell to federal agencies, a key growth market for the company.

Altogether, Okta offers long-term growth potential, leadership in the cloud identity niche, and ramping profitability. This makes the stock well-positioned to deliver long-term growth.

2. Coupang

E-commerce stocks have gotten hit hard over the last year, but one stock that still looks appealing over the long term is Coupang (CPNG -1.58%), South Korea's leading e-commerce platform. By operating in South Korea, the company benefits from tapping perhaps the market best suited to e-commerce in the world.

South Korea is one of the most densely populated countries in the world. A dense population is easier for an e-commerce company to serve, as there are more potential customers per square mile to serve.

Additionally, South Korea is one of the wealthiest countries in the world, giving shoppers disposable income. It also has the fastest internet in the world, according to some measurements, which also makes it an ideal market.

As for Coupang, the company is still growing quickly, with revenue increasing by 21% in its fourth quarter to $5.3 billion on a currency-neutral basis. Profitability is also ramping up, as it's followed in Amazon's footsteps by launching a low-margin first-party e-commerce business first, followed by a higher-margin third-party marketplace.

In the fourth quarter, gross profit jumped 59% to $1.3 billion. The company posted adjusted earnings before interest, taxes, depreciation, and amortization (EBITDA) of $211 million, compared to a loss of $285.1 million in the quarter a year ago.

Like Amazon, Coupang has its own Prime-like program called Wow, which reached 11 million paid members at the end of 2022, up 20% from the year before. Wow should help strengthen Coupang's customer loyalty.

As Coupang continues to capture the opportunity in South Korea and beyond and ramp up profitability as the business scales, the stock has a lot of upside potential over the long term.