The Roger Federer Foundation has been supporting Imbewu, an aid agency for disadvantaged children in South Africa, since May 2004.
In addition to this charitable involvement, Federer was appointed a Goodwill Ambassador for the United Nations Children's Fund (Unicef) in April 2006 – the only male tennis player to have had this role.
"I've been lucky in life and able to pursue my passion for tennis since I was six years old. It's important to me to help the many children throughout the world who do not have the basic resources they need," Federer said on becoming a Goodwill Ambassador.
Lynette Federer, Roger's mother and a member of the Roger Federer Foundation council, told swissinfo how ideas were turned into action when her son's tennis career took off (listen to audio).
"At the end of 2003, when Roger was having great success in tennis, we discussed [forming a foundation] within the management because we felt that he wanted to give something back," she said.
Lynette Federer explained why the foundation's first project was a partnership with Imbewu.
"I'm South African and my husband and I travel there twice a year – we've got an opportunity to visit the project and really see what work is being done," she said.
"With a small project you have a better overview of what's happening. You know all the people working there and you can really see the improvements among the children and the community."
In March 2005 Roger Federer visited schoolchildren who benefit from the Imbewu scheme in the townships near Port Elizabeth, the biggest city in the Eastern Cape.
"The partnership provides schooling and two meals a day for 30 children across three schools, providing them with uniforms and writing materials as well as enabling them to take part in special activities," Lynette Federer said.
The visit made a big impression on her son, who also visited children with Aids and tuberculosis at a hospital in the township of New Brighton. "Seeing the reaction of the kids was overwhelming," he said.
"It has been a day full of emotional experiences and it was depressing to see the poor circumstances many of these children have to live in. I am convinced that we are heading in the right direction with this support."
A second goal of the foundation is to promote sport for young people. During his visit Federer took part in football and basketball matches with local students and teachers.
"Sport is the best school of life," Adolf Ogi, former Swiss cabinet minister and the UN special adviser on sport for development and peace, told swissinfo.
"The value of the skills that a child learns through sport such as cooperation, teamwork, respect, fair play, discipline, self-esteem, resilience, leadership... is inestimable."
Ogi added: "Roger's support... means a better life for more than 100 children in South Africa. I hope that other successful athletes will be similarly moved to contribute as role models and humanitarians to projects."
Ogi also praised Federer as a tennis player, role model and humanitarian.
"The fact that he can be described as all three is a feat in itself! Roger's modesty, generosity, accessibility and honesty make him an ideal role model. His commitment to issues beyond his world-class sporting career reflect his curiosity and desire to make real changes in the lives of those less fortunate."
Federer isn't the only tennis player to have a charity – the Andre Agassi Charitable Foundation and the Andy Roddick Foundation for example have raised millions for good causes – but he is the first to be appointed a Unicef Goodwill Ambassador.
Speaking at Unicef's New York headquarters in April 2006, Federer said he felt honoured to be part of efforts to help children across the world who don't have the basic means to survive.
"I may have achieved a lot on the court, but I would also like to try to achieve more now off the court," he said. "That's one of my big goals, and it's really a privilege for me to continue this great tradition of Unicef."
Federer has headed several Unicef fundraising campaigns for the victims of the 2004 tsunami in southeast Asia.
In December 2006 he visited Unicef's tsunami recovery programmes in Cuddalore, in India's hardest-hit state of Tamil Nadu, including a protection centre for children and orphans.
"I told the children that I would always be there for them. Children are our future, and for that reason I have tried to inspire them."
swissinfo, Thomas Stephens
Roger Federer Foundation
The Roger Federer Foundation was established in December 2003 with two goals: to fund projects that benefit disadvantaged children and to promote sport for young people.
It is a charitable grant-making foundation and has a total capital of SFr1.6 million ($1.5 million).
Federer has also been active in supporting tsunami relief efforts and he was the driving force behind a charity exhibition during the Indian Wells Masters in March 2005 designed to benefit Unicef tsunami relief efforts.
Since 2001 the local organisation Imbewu Community Volunteers (Imbewu means "seed" in the local language, Xhosa) has worked to improve social conditions for children and young people in the New Brighton Township near Port Elizabeth in southeastern South Africa.
All six projects supported and managed by Imbewu revolve around education, health, sports and cultural programmes. The biggest project is a sponsorship scheme under which 100 Swiss families subsidise 134 children.
Unicef Goodwill Ambassadors are active on a national, regional and international level to support projects aimed at improving the lives of children. The first Goodwill Ambassador was the US actor Danny Kaye in 1954.
Roger Federer was appointed Goodwill Ambassador in April 2006 but stood down in February 2009 because his agenda "was not allowing him to carry on his duties in a way that was satisfactory to him", according to Unicef.
"Federer asked us to put his name as part of an alumni club to show that there is always a link with Unicef. It is possible that in the future we can ask his support again for a very global and important event," the organisation said.
Federer was Switzerland's second Goodwill Ambassador. English-born Sir Peter Ustinov, who later took Swiss nationality, had held the position for more than 35 years when he died in 2004. Currently television presenter Kurt Aeschbacher is Switzerland's only Goodwill Ambassador.