Obama, who lived in Jakarta briefly as a child, said he had been encouraged by Indonesia's rejection of authoritarianism and embrace of democracy after Suharto's fall in 1998.
The president gave his speech to an audience of more than 6,000 at the University of Indonesia as part of a four nation, eight-day Asia tour designed to cement US strategic relations and to drum up export markets.
His speech also reflected on his Cairo address to the Muslim world in 2009 when he vowed to forge a "new beginning" with Islam, following years of distrust fuelled by US wars in Iraq and Afghanistan.
"As I said then, and will repeat now ... no single speech can eradicate years of mistrust," he said, and vowed to do the hard work of forming common ground where suspicion and trust reigned.
Obama held up Indonesia - which traditionally practices a tolerant form of Islam and has Christian, Hindu and Buddhist mintorities - as an example of tolerance to the world in a tense age of colliding cultures.
"Even as this land of my youth has changed in so many ways, those things that I learned to love about Indonesia - that spirit of tolerance that is written into your constitution, symbolised in your mosques and churches and temples, and embodied in your people still lives on," he said.
During Obama's talks Tuesday with President Susilo Bambang Yudhoyono, the two countries sealed a "comprehensive partnership" designed to boost ties across a range of fields, including security, trade and climate change.