The surging price of Microsoft shares has returned US tech tycoon Bill Gates back to the top of Forbes's world's billionaires list, with his $76 billion beating out Mexico's Carlos Slim's $72 billion.

The annual list counted 1,645 men and women as billionaires, with an average wealth of $4.5 billion and a collective wealth of $6.4 trillion, up $1 trillion from a year ago.

Mr Gates, co-founder of the US software firm, showed his staying power at the top - the world's richest man for 15 of the past 20 years, according to Forbes - despite spending recent years giving away large sums of money to global health and anti-poverty programs.

Mr Gates owns about 4.4% of Microsoft, making up less than 20% of his total fortune.

But the company's share price has risen 25% over the past year, and, along with gains in other assets, he has added $7 billion to his fortune since a year ago, according to Forbes.

Mr Slim, with a hand in everything from telecommunications (America Movil) to mining, finance and industry (Grupo Carso), to retailing and real estate across the Americas region, was worth $1 billion less than a year ago, hit in part by sagging markets in South America.

In third was Spain's Amancio Ortega, whose pockets have filled with profits from fashion: his hugely successful Inditex garment empire, parent of popular chains Zara, Pull & Bear, and Bershka. 

More recently, Mr Ortega heavily invested in real estate in Europe and the United States; his worth was put at $64 billion.

A familiar cast of mega-wealthy filled out the rest of the top ten: US investment guru Warren Buffett ($58.2 billion); software group Oracle's founder and chief executive Larry Ellison ($48 billion); US industrialists and brothers Charles and David Koch (each with $40 billion); Las Vegas casino king Sheldon Adelson ($38 billion); Walmart heiress Christy Walton ($36.7 billion) and her brother Jim Walton ($34.7 billion).

Together the $507 billion held by the top ten is larger than the entire size of the economy of Norway, or Belgium or Poland in 2012.

Forbes found 1,645 billionaires in total – 172 of which were women.

Five Irishmen make billionaire list

With a net worth of $12.8 billion, Pallonji Mistry was ranked as the richest Irish person in the world and 82nd overall. Mr Mistry, who has a significant shareholding in Tata Motors and is chairman of construction firm Shapoorji Pallonji Group, became an Irish citizen in 2003.

Denis O’Brien is the second wealthiest Irishman with a net worth of $6 billion – ranking him 234th overall – largely due to his Digicel phone network.

Campbells Soup heir John Dorrance III was the third wealthiest Irishman with $2.5 billion. He moved to Ireland two decades ago, prior to selling his stake in the food company.

Glen Dimplex founder Martin Naughten was fourth amongst the Irish, with a net worth of $2.2 billion, while investor Dermot Desmond was ranked fifth with $2 billion – putting him 869th richest overall.