Apple is on the verge of becoming the first $1 trillion publicly listed US company, but even if it gets there, it could soon be overtaken as Amazon.com surges from behind. 

Started in the garage of co-founder Steve Jobs in 1976, the iPhone maker's annual revenue has ballooned to $229 billion, greater than the gross domestic product of countries including Portugal and New Zealand.

Apple's market capitalisation last week topped a record $934 billion, following its unveiling of a $100 billion buyback budget and news that Warren Buffett's Berkshire Hathaway dramatically increased its stake in the company. 

Big tech's revenue rivalled many countries' GDP last year

Thanks to a rally since its quarterly report last Tuesday, the California company is just 8% short of hitting the $1 trillion valuation mark. 

But Apple is in danger of being beaten to the $1 trillion mark - or passed soon after - by Amazon.com, the second largest listed US company by market value, at $780 billion. 

Saudi Arabian authorities, meanwhile, have said they expect a planned international initial public offering of Saudi Aramco that would value the national oil producer at about $2 trillion. 

While $148 billion smaller than Apple on Friday, Amazon of late has expanded its stock price, and its sales, much more quickly than Apple. 

Amazon's stock is red hot, trading recently at over 100 times expected earnings, compared to more-profitable - but slower growing - Apple's valuation of 15 times earnings.

Apple's stock has risen 24% over the past year, fueled by optimism about the iPhone X, the company's latest smartphone. 

But demand for the $1,000 device has underwhelmed investors, and bulls are now focused on Apple's plan to return more cash to shareholders. 

By comparison, Amazon's stock has surged 70% over the past 12 months, bolstered by 31% revenue growth as more shopping moves online and businesses shift their IT departments to the cloud, where Amazon Web Services leads the market. 

Amazon is also competing more with Apple and Google owner Alphabet as it sells music and video content, its Fire TV device and its Alexa smart home gadget.

At $765 billion, Alphabet has the third largest market capitalisation on Wall Street, with Microsoft close behind at $749 billion. Amazon breezed past both them both in February.

Including Facebook, the five largest listed US companies now account for 15% of the S&P 500's $24 trillion market capitalisation. 

But past stock gains are not a reliable predictor of future performance, and the surge in Apple's and Amazon's shares in recent years has been exceptional by most standards. 

But if Apple's stock were to keep growing at the pace seen over the past year, the company's market capitalisation would hit $1 trillion in September. 

Amazon would reach $1 trillion around October if its stock price continued to rise at the same rate as the past year, and overtake Apple soon after. 

Extending forward their own one-year performances, Microsoft would not reach $1 trillion until early 2019, and Alphabet would take until 2020.

Most Wall Street analysts are less optimistic. The mean analyst price target puts Apple's stock 6% above current levels at $200 within the next 12 months, which would elevate its market capitalisation to $983 billion, according to Thomson Reuters data. 

The mean price target of analysts covering Amazon is $1,850, a 15% premium over its current price, which would give it a market value of $898 billion. 

Analysts target Microsoft to rise 12% to reach $845 billion, and for Alphabet's market value to increase 16% to $884 billion.