"Today we celebrate the birthday of Mahatma Gandhi and his resonant legacy of non-violence," Ban said in a statement.
"Gandhi showed the power of peacefully opposing oppression, injustice and hatred. His example has inspired many other history-makers such as Martin Luther King Jr., Václav Havel, Rigoberta Menchú Tum and Nelson Mandela," he said.
Ban Ki-moon urged the world to be inspired by the courage shown by Gandhiji.
Calling on people across the world to be inspired by people like Mahatma Gandhi, Ban said: "Turn your back to division and hatred; stand up for what is right and just. Work with your fellow women and men for a world of lasting justice, peace and prosperity for all."
He said the UN stood for peaceful resolution of disputes and an end to all forms of violence.
"Ending such violence can start with each of us - in homes, schools and workplaces. Violence can be contagious, but so can peaceful dialogue," he said.