Software giant's founder has sold 90m shares in 12 months, but still has 500m; cash goes to help his foundation's charitable work

Bill Gates has sold another 5 million of his Microsoft shares, according to a regulatory filing.

Microsoft's multi-billionaire founder has been selling shares in recent months. He is the company's non-executive chairman, having stepped back from running the software firm in 2008 to concentrate on his charity work.

According to the filing, Gates sold 5m shares in Microsoft at an average $27.59 each on July 27. He has sold more than 90m Microsoft shares in the past 12 months.

Gates still has more than 500m shares in the company, but has decreased his shareholding over the last two years to fund his charitable endeavours and to diversify his portfolio.

This week the Bill & Melinda Gates Foundation said it was making $42m available for eight universities to develop a toilet that does not need a sewer connection, water or electricity to operate. The aim is to improve people's health in parts of the world where there are few if any flushable toilets.

He is also backing research into improving education. "Every student needs a meaningful credential beyond high school," Gates said in a speech last week. "Higher education is crucial for jobs," he said, calling education an equaliser in society and the answer to getting urban America back to work and fighting poverty.

Forbes magazine estimates Gates's fortune at $56bn. Once the world's richest man, he is now second to Mexican telecoms mogul Carlos Slim after giving away a large chunk of his fortune to his charity.

Gates and long-time friend Warren Buffett have pledged to give away the majority of their fortunes to charity before their deaths, and have convinced a host of other billionaires, including Facebook's Mark Zuckerberg, to follow suit.