Meta Platforms' (META -2.41%) stock has rallied by about 180% over the past 12 months and now trades just a few dollars shy of its all-time high. Investors rushed back to the social media giant as its advertising business recovered, and as management expanded its share buyback authorization by $50 billion and initiated a dividend.

That rally lifted Meta's market cap past the trillion-dollar mark for the first time in two years this January, and it's now worth $1.2 trillion. However, Meta is still less valuable than Apple (AAPL 2.48%), which has throttled the company's ad sales over the past three years by improving the user-privacy aspects of the iOS mobile operating system.

An investor checks a stock portfolio on a laptop computer.

Image source: Getty Images.

But now that Meta's business is firing on all cylinders again, could it overtake Apple -- which currently has a market cap of $2.8 trillion -- by 2030?

How much could Meta be worth by 2030?

Meta's growth stalled out in 2022 as it struggled with fierce competition from ByteDance's TikTok, macro headwinds for the advertising market, and the impact of Apple's user-privacy upgrades. Its Reality Labs unit, which houses its metaverse efforts and its virtual and augmented reality devices, also continued to lose billions of dollars every quarter. During that challenging year, Meta's revenue and earnings per share (EPS) declined by 1% and 38%, respectively.

But in 2023, Meta's revenue and EPS rose 16% and 73%, respectively, as its advertising business recovered. It countered Apple's iOS changes by gathering more first-party data with its own AI algorithms, challenged TikTok by expanding its Reels short video platform on Facebook and Instagram, and offset its declining ad prices by selling more ad impressions. It also attracted a lot of new ad purchases from Chinese e-commerce and gaming companies, which were trying to reach more overseas customers; China-based advertisers drove 5 percentage points of its total revenue growth during the year.

From 2023 to 2026, analysts expect Meta's revenue and earnings to grow at a compound annual rate of 14% and 22%, respectively. Its stock still looks reasonably valued relative to those estimates at 24 times forward earnings.

If Meta matches those estimates and continues to grow its bottom line at a compound annual rate of 15% from 2026 to 2030, its EPS could rise to $46.70. If its forward multiple remains roughly the same, in early 2030, its stock could be trading at about $1,120, giving it a market cap of nearly $2.8 trillion. That would match Apple's current valuation.

How much could Apple be worth by 2030?

Apple also suffered a slowdown over the past three years. In its fiscal 2022 (which ended Sept. 24, 2022), its revenue and EPS only rose 8% and 9%, respectively, as it lapped a period of robust sales of its first 5G handset, the iPhone 12. In fiscal 2023, Apple's revenue fell 3% and its earnings stayed nearly flat as the 5G upgrade cycle ended and its sales of Macs withered in a post-pandemic market. China's economic slowdown and tough currency headwinds exacerbated that pressure.

From fiscal 2023 to fiscal 2026, analysts expect Apple's revenue and earnings to grow at a compound annual rate of 4% and 8%, respectively. Those growth rates look stable, but they're not that impressive for a stock that trades at 28 times forward earnings.

Apple still trades at a premium to its growth because it's widely considered a safe-haven stock. The company can still diversify its portfolio away from the iPhone over the next few years with fresh products and subscription services, and it could expand through acquisitions and investments by tapping its $173 billion in cash and marketable securities. However, its price-to-earnings ratio could gradually contract if it doesn't reaccelerate its growth.

If Apple meets analysts' expectations and grows its EPS at a modest compound annual rate of 8% from fiscal 2026 to fiscal 2030, its EPS could reach $10.50. If its valuation remained at 28 times forward earnings at that point, its stock would be trading at $294, giving it a market cap of $4.5 trillion. But if Apple's forward multiple dropped to 20 -- in line with other mature tech companies -- its stock price of $210 per share would give it a market cap of $3.2 trillion.

Meta might have more upside potential than Apple

Based on those calculations and forecasts, Meta probably won't be worth more than Apple by 2030, but it could have a lot more upside potential than the iPhone maker. For Meta to reach Apple's current market cap by 2030, its stock would have to more than double from its current levels.

Meanwhile, Apple could struggle to match those gains if it continues to generate single-digit percentage earnings growth while trading at premium valuations. That outlook might change if the Vision Pro takes off or if Apple launches other revolutionary products or services -- but it will take a lot of work to diversify the business away from its dependence on the iPhone.