Mr Gates, whose wealth is estimated at $86 billion, led the list for the fourth straight year.
He was followed by Berkshire Hathaway chief Warren Buffett among the top 10 billionaires, a group heavily dominated by Americans, many of whom work in the technology sector.
Mr Buffett's wealth was estimated at $75.6 billion.
Others in the top 10 included Amazon founder Jeff Bezos at number three, Facebook creator Mark Zuckerberg at number five and Oracle co-founder Larry Ellison at number seven.
The global billionaire population jumped 13 per cent from last year to 2,043, the biggest annual increase in the 31 years since the magazine began compiling the list, Forbes said.
The US led countries with the most billionaires with 565, a product of the swelling value of the American stock market since Mr Trump's November 2016 election.
Mr Trump slipped 220 spots on the list to number 544 with an estimated $3.5 billion. Forbes attributed Mr Trump's drop to sluggishness in the Manhattan real estate market which is responsible for a disproportionate amount of his wealth.
"Forty per cent of Donald Trump's fortune is tied up in Trump Tower and eight buildings within one mile of it," Forbes said. "Lately, the neighborhood has been struggling (relatively speaking)."
Among others in the Forbes top 10, Amancio Ortega of Spanish apparel chain Zara was fourth, Mexican telecom tycoon Carlos Slim was sixth, the Koch brothers, Charles and David, were eighth and ninth, and former New York City mayor and Bloomberg News founder Michael Bloomberg was 10th.
This year it took at least $3.7 billion in wealth to make it onto the list, but only in a tie for 501th place, a group that included Hollywood director Steven Spielberg.