They said they "no longer believe" that they can grow as a couple.
The American business magnate and co-founder of Microsoft is the third-richest man in the world.
The couple met during a business dinner in 1987, when Melinda Gates was a product manager at Microsoft. The pair then married around seven years later.
The financial details of the separation have not been revealed. Both Gateses have signed on to Warren Buffett's Giving Pledge, promising to donate most of their fortune to charitable causes.
What did the Gateses say?
"After a great deal of thought and a lot of work on our relationship, we have made the decision to end our marriage," Gates tweeted.
"We have raised three incredible children and built a foundation that works all over the world to enable all people to lead healthy, productive lives,'' they said.
"We ask for space and privacy for our family as we begin to navigate this new life.''
Bill Gates (@BillGates) May 3, 2021
What this means for the Bill & Melinda Gates Foundation
Despite the end of their marriage, Gates said they would continue to collaborate on the Bill & Melinda Gates Foundation.
"We continue to share a belief in that mission and will continue our work together."
The foundation has over $50 billion (€41.4 billion) in assets, according to a tax filing cited by US broadcaster CNBC.
Since its launch in 2000, the charity has focused on global health and development issues as well as education in the US.
The Gateses have also invested vast sums of money in the search for a coronavirus vaccine and have donated to COVID-19 treatment research.