Barack Obama has warned that irresponsible use of social media is distorting people's understanding of complex issues and leading to the spread of misinformation.
The former US president said people in positions of power should exercise care when posting messages.
His successor Donald Trump regularly uses Twitter, often sparking controversy with his comments. The current president says using Twitter allows him to speak directly to the American people and bypass "fake media".
Mr Obama did not name Mr Trump during the interview, which he did with Prince Harry for the royal's guest editorship of BBC Radio 4's Today programme.
The Democrat, who handed over power to Mr Trump in January 2017, said social media is corroding civil discourse.
Mr Obama said: "One of the dangers of the internet is that people can have entirely different realities. They can be cocooned in information that reinforces their current biases.
"The question has to do with how do we harness this technology in a way that allows a multiplicity of voices, allows a diversity of views, but doesn't lead to a Balkanisation of society and allows ways of finding common ground."
Mr Obama also looked back on the day he handed over power to Mr Trump and despite feeling satisfied he says it was "mixed with all the work that was still undone".
He added: "Concerns about how the country moves forward but, you know, overall there was serenity there."