You don't need a lot of money to benefit from the long-term growth of the U.S. stock market. With just $1,000, you've got a tremendous number of choices.

For investors looking for a hands-off approach, a broad-market index fund may be the best option. But for those willing to take a little risk, buying high quality individual stocks and holding them for years is a great bet.

Two top stocks to buy now are DigitalOcean (DOCN 0.25%) and Taiwan Semiconductor Manufacturing (TSM -1.56%).

A dial reading quality.

Image source: Getty Images.

DigitalOcean: Simplifying cloud and AI

Big cloud computing platforms like Amazon Web Services and Microsoft Azure are built for big enterprises with vast budgets. On these mega-cloud platforms, there's every cloud and artificial intelligence (AI) product and service one could ever want -- but one hidden cost is complexity. That's not ideal for small businesses and developers.

DigitalOcean has carved out a niche in the cloud computing market by keeping things simple. The company's cloud platform is narrower than the big players in the industry, and its pricing is more transparent.

Recently, DigitalOcean has taken the same strategy and applied it to artificial intelligence. The Gradient AI platform, which DigitalOcean launched in July, combines the company's AI infrastructure offerings with high-value tools that allow customers to easily build and deploy AI agents.

DigitalOcean's AI push is already starting to show up in the company's results. Revenue grew by 14% year over year in the second quarter, and the company gained the most annual recurring revenue in nearly three years, thanks to a more than doubling of AI-related revenue.

The company's highest-spending customer cohort, which, on average spend $30,000 monthly on the platform, now accounts for nearly a quarter of total revenue. While DigitalOcean still caters to smaller customers, those bigger customers help make the company's revenue a bit more predictable.

DigitalOcean is profitable and cash-flow positive. The company is calling for its adjusted free-cash-flow margin to be as high as 19% of revenue for the full year. With a reasonable valuation of around 18 times that free-cash-flow guidance, DigitalOcean stock looks like a compelling long-term buy for growth investors.

TSMC: Overwhelmingly dominant

Taiwan Semiconductor Manufacturing dominates the global foundry market, particularly for the most advanced nodes required for cutting-edge semiconductor chips. The company faces competition from Samsung and Intel, with the former recently winning a deal to manufacture future chips for Tesla and the latter betting on its upcoming Intel 14A process to shake up the industry.

While both represent real threats, TSMC's lead will be tough to overcome.

TSMC produced revenue of $30.1 billion in the second quarter, up an astonishing 44.4% year over year. Nearly one-quarter of the company's shipments now use TSMC's advanced 3-nanometer (nm) node, and three-quarters of shipments use 7nm or better manufacturing processes. Booming demand for AI accelerators, which benefit from the most advanced manufacturing nodes available, as well as complex advanced packaging techniques, is a key driver of TSMC's soaring revenue.

TSMC's profitability is also incredible. Gross margin was 58.6% in the second quarter, and the company managed a net profit margin of 42.7%. With its leading position in the industry and no viable alternative for companies like Nvidia, which need advanced manufacturing at scale, TSMC will continue to benefit from the AI boom.

There are some risks -- namely, TSMC being based in Taiwan. That exposes the company to the potential impacts of changes in U.S. tariff policy, as well as the looming threat of China taking military action. However, it's tough to find a better growth stock in the semiconductor industry than TSMC.