Alibaba, the internet trading company founded in a cramped one-bedroom flat in China 15 years ago, stunned investors on Friday by becoming the 18th-biggest company in the world by valuation, ahead of Facebook, Amazon and eBay.

Shares in the firm, founded by a Chinese English teacher-turned businessman, soared to $92.70 as trading began – a 36% premium above the offer price – on the New York stock exchange. At one point the shares came within a whisker of $100 before falling back.

The share price surge valued the company at $230bn (£141bn) – more than Amazon and eBay combined, and more than JP Morgan, the biggest bank in the US. It was one of the world's three biggest-ever flotations, and a record on Wall Street.

Analysts said investors were desperate to buy shares in the company because it offers a way of tapping into China's growing middle class. The company's various websites account for more than 80% of all goods bought online in China and more than half of all parcels delivered throughout the country.

Jack Ma, the company's founder who became an internet entrepreneur after twice failing his university entrance exams, cemented his position as China's richest man with his 9% stake valued at nearly $21bn.

Thousands of employees from his home town, Hangzhou, also became paper millionaires as Ma had followed Silicon Valley startups by sharing stock among employees of all levels, from senior managers to receptionists.

"We have a dream," Ma said as he rang the opening bell to officially launch the flotation on the NYSE. "We hope in the next 15 years the world changes because of us. We hope in 15 years people say this is a company like Microsoft, IBM, Walmart. They changed, shaped the world … We want to be bigger than Walmart."

By the end of the day his dream had almost come true as Alibaba's market capitalisation of $230bn was in sight of Walmart's $245bn.

Ma claims to have got his inspiration from an unusual source: "The hero I had is Forrest Gump," he told CNBC from the floor of the stock exchange. "I really like that guy … Every time I get frustrated, I watch the movie.

"I watched the movie again [before the float] telling me no matter what changed, you are you. I'm still the guy [of] 15 years ago, you know, I only earned like $20 a month. And today I can do [this] much."

Ma said if he – who, like Tom Hanks' character, struggled in school – can make it then "80% of the young people in the world can be successful".

"We don't have the rich daddy, powerful uncle," he said. "We do it from nothing. So that's what it means for China." Asked what he will do with his vast fortune, Ma said: "This is a headache … I guess I'm going to spend."

He recalled asking his wife at the founding of the company in 1999 whether she wanted her husband to be a "rich man or a respected business guy". "She said, of course, a respected business person because she never thought I would be a rich person," he said.

Ma became obsessed with the internet on a trip to the Seattle in 1995; the first thing he searched for was "beer".

He came up with the name Alibaba in a San Francisco coffee shop; when he asked a waitress what she knew about Ali Baba, she replied: "Open Sesame." Ma says the name reflects how the company opens up opportunities for small businesses to sell their goods across the world.

Alibaba started as an online marketplace for businesses to sell products to one another but quickly expanded into consumer sales and online payments. It is now a global hub for selling everything from electronics to stuffed animals.

The offering of 320m shares raised more than $29bn.

Online spending by Chinese shoppers is forecast to triple from its 2011 size by 2015, and Ma said the company would soon expand into emerging markets and eventually Europe and the US.

The company's sales in the three months to the end of June rose 46%, compared to the previous year, to $2.54bn. Sales were up 60% to almost $1.2bn.

"There are very few companies that are this big, grow this fast, and are this profitable," Gil Luria, an analyst at Wedbush, said.

Reena Aggarwal, a business professor at Georgetown University, said: "The business model is really interesting. It's not just an eBay, it's not an Amazon, it's not a Paypal. It's all of that and much more."