Building a retirement portfolio that's worth a million dollars is not an insurmountable task. All it takes is a few decades of consistently adding relatively reasonable amounts of money to a diversified stock portfolio every month.

If, for example, your portfolio's value is $50,000 today, and you add $200 a month to it steadily from here, it will be worth over $1 million in 30 years, assuming an average rate of return of 10% annually. And that's not an unreasonable assumption -- that's been the market's average annualized rate of return over the long haul.

If you have savings sitting in your bank account earning close to zero in interest, perhaps this can be an inspiration to start up that investment account. The best time to begin was yesterday; the second best time to begin is now.

But what stocks should you buy for your portfolio? To generate solid long-term returns, you cannot go wrong with some technology giants that are trading today at reasonable prices. Here's why Amazon (AMZN -0.68%) and Alphabet (GOOG -0.70%) can help lift your portfolio's value past the $1 million mark by the time you retire.

Amazon's long-term dominance

Steady growth has been the name of the game at Amazon, and that has made it a monster stock to own over the last few decades. The company has a dominant position in e-commerce in the United States -- and a few other countries as well -- while simultaneously leading the global cloud computing market with its Amazon Web Services (AWS) division.

E-commerce still has plenty of market share it can steal from physical retail, even in Amazon's home country. E-commerce as a percentage of total retail sales in the United States sat at just 16.2% as of the first quarter of 2025. Despite Amazon's large presence and popularity, online shopping does not account for even $1 out of every $5 spent at retail. While e-commerce's share will not ever approach 100% due to items like fresh groceries -- although Amazon and others are working hard to deliver these, too -- e-commerce should become a much larger piece of the pie in the years to come.

Amazon's North American retail sales grew by 8% year over year last quarter, while international sales grew 8% as well when factoring out foreign currency fluctuations. Those revenues could easily keep growing at similar rates for years.

AWS grew by an even faster 17%. The cloud computing segment is now generating over $100 billion in revenue and experiencing supercharged growth due to the rising demand for artificial intelligence infrastructure. A study by research firm Roots Analysis forecast that the cloud computing market will grow at a 15% annualized rate through 2035, providing a nice tailwind for this business.

Today, Amazon's market capitalization is around $2.2 trillion, and it generated $72 billion in operating income over its last four reported quarters. With durable growth still left to be had in both e-commerce and cloud computing, Amazon can deliver strong returns for your portfolio over the long term.

A woman with pen touching chin looking up with a lightbulb sketch in the background.

Image source: Getty Images.

Alphabet's AI infrastructure

Investors have some doubts about Alphabet today -- they're worried about new competition eating its lunch. The tech giant that owns Google Search, Google Cloud, YouTube, Waymo, and Google DeepMind has seen its stock price growth lag behind its peers; it now trades at a price-to-earnings ratio (P/E) of 20, much lower than the competition. Meanwhile, artificial intelligence (AI) powerhouse OpenAI is closing in on $10 billion in annual recurring revenue (ARR) and is aggressively trying to steal market share from Google Search.

So far, the things that are worrying investors have not had a discernible impact on Alphabet's financial statements. Google Search revenue grew to $50.7 billion last quarter, helping to lift its overall revenue by 14% year over year on a currency-neutral basis. OpenAI and its ChatGPT large language model are definitely competitors to Alphabet, but the tech giant is fighting back hard: Its Google AI tools are getting strong usage, and its Gemini chatbot is catching up with ChatGPT in usage, according to surveys.

Plus, Alphabet has become far more than just Google Search. Its Google Cloud unit has been set up for success in the AI era due to the company's immense long-term investments in infrastructure to support AI systems. In fact, it's doing so well at deploying AI capacity that OpenAI has signed a deal with Google Cloud for its computing needs.

In addition, YouTube is growing and increasing the share of video-viewing time it accounts for in the United States, while autonomous driving subsidiary Waymo is expanding its robotaxi service across the country and beginning to disrupt the ride-sharing market.

Even if Alphabet struggles in AI and cedes some revenue to OpenAI and other rivals, it has many ways to grow its revenue and earnings over the long haul, especially with Google Cloud. That division has closed in on $50 billion in annualized revenue and is growing by 28% year over year. Within five years, investors should expect the division to generate well over $100 billion in revenue annually and contribute significantly to Alphabet's profits.

At a cheap P/E ratio of 20 and with a history of technological innovations, strong revenue growth, and magnificent earnings power, Alphabet stock looks like a great long-term bet for your portfolio.