It wasn't too long ago when it seemed like a ridiculous concept for a business to be worth $1 trillion. Even now, it's still a pretty elusive achievement.

As of this writing, only five companies in the U.S. stock market have market caps greater than $1 trillion, and only seven more are over halfway there. But it's safe to say that the list of trillion-dollar companies could get much longer by the end of the decade.

For this discussion, I'm only considering stocks that have a long way to go to join the trillion-dollar club. As an example, I'd argue that Berkshire Hathaway will hit a $1 trillion market cap by 2030, but with a roughly $800 billion valuation today, it would be disappointing if it didn't.

With that in mind, here are two companies, both of which currently have market caps under $260 billion, that might have a better chance of a trillion-dollar valuation than the market is giving them credit for.

Warren Buffett's favorite bank stock

Bank of America (BAC -0.21%) -- and bank stocks, in general -- have underperformed the market over the past couple of years, and for some good reasons. First, while rising interest rates can be a good thing for banks (higher interest income), they can also precede recessions, which can cause elevated loan delinquency rates. Plus, in the case of big banks, deposits have been contracting, as many people are choosing to put their money into high-yield savings accounts that pay significantly more.

Having said that, Bank of America is an extremely well-run bank, and there's a case to be made that it could be a trillion-dollar stock by the end of the decade.

First, as interest rates start to come down, as most experts are projecting, Bank of America's valuation could adjust higher as the market's perception of loan default risk declines. Bank of America traded for a price-to-book multiple of 1.6 at the start of 2022, and that has fallen to about 0.96 times book today. Based on valuation alone, in a strong economic climate, Bank of America's market cap could rise by more than 65%.

Second, in a stronger economy, Bank of America's growth would likely improve. Its business continues to add customers. For example, over 600,000 net new checking accounts, 4.6 million credit card accounts, and 3.8 million consumer investment accounts were added in 2023 alone. This should set the bank up for long-term revenue growth.

Management has done a great job of buying back shares and growing the dividend. If the business (and economy) does well, Bank of America -- which is Berkshire Hathaway's second-largest stock holding -- could become a trillion-dollar stock.

The other GPU company

Advanced Micro Devices (AMD 2.37%) is a chipmaker that is best known for its microprocessor products but also makes graphics processing units (GPUs), data processing chips, and other semiconductor products for a variety of applications.

While Nvidia is the dominant GPU leader, AMD could have a lot of room to grow in the area. Data center GPUs are a big one. Nvidia currently has about 95% of that market, but AMD has started rolling out its own, designed to challenge its rival's high-end artificial intelligence (AI) processors.

Thanks to the boom in AI technology, the data center accelerator market is expected to grow to about five times its current size by 2030, according to Grand View Research. Plus, the GPU market itself -- which includes all applications, not just data centers -- is expected to grow tenfold over the next decade.

While data center GPUs are a particularly interesting opportunity, AMD currently has less than 15% of the overall GPU market. If it can successfully capture some of Nvidia's leading share and ride the industry tailwinds, it could become a trillion-dollar company by the end of the decade.

A lot would need to go right

As a final thought, it's important to say that there's a lot that would need to go right for these two stocks to reach a trillion-dollar market cap by 2030. Bank of America would likely need a strong economy, as well as several years of strong loan growth to get there. AMD would need its AI-focused chips to gain serious traction and take market share from its larger market-leading rival.

Even if these things do happen and the stocks reach trillion-dollar market caps, the path isn't likely to be a smooth one. Invest with this in mind.