U.S. President Barack Obama told Britain's Prince Harry one danger of the internet is "that people can have entirely different realities" and surround themselves in information that "reinforces their current biases."
Harry interviewed Obama in September for Wednesday's broadcast on BBC Radio.
The former U.S. leader, who left office in January after serving eight years, said it is important that online communities move offline and allow people to get to know each other.
"On the internet everything is amplified, and when you meet people face-to-face it turns out they're complicated," Obama said. "You find areas of common ground because you see that things are not as simple as have been portrayed in whatever chat room you've been in."
He added that in person it is more difficult to be "as obnoxious and cruel" as people can be online.
Obama said he missed the work of the president, "because it was fascinating," but that he had a sense of "serenity" in leaving the office and now has the ability to focus his efforts on long-term problems in a way he could not while in the White House.
"It allows me to focus on how do I transmit whatever knowledge or experience that I've gained to others to help them become more effective and more powerful," he said. "And I'm really obsessed now with training the next generation of leaders to be able to make their mark in the world."
He pointed to the example of recent hurricanes in Texas, Florida and Puerto Rico, saying as president his primary job would have been to make sure the people in those areas got help.
"Today those aren't my direct responsibilities, but I can focus over the next 20 years on making sure we don't have more hurricanes and natural disasters that are accelerated as a consequence of climate change," Obama said.
He also spoke about the importance of empowering young people to make decisions and said there is an "energy and spirit" to the younger generation that cannot be matched by someone his age.
"There is a freshness to what young people perceive as possible," he said.
Obama also talked about leadership, saying that he does not believe someone in a position of power can do their job well if they lack "the capacity to feel deeply about the people they are serving."
"If you don't understand that what you do every day has a profound impact on somebody else, then you shouldn't be there."