The loyalty pledge would be expected to cover elected officials, civil servants, and council workers.
Mr Javid’s proposal comes in response to a report on social cohesion by Dame Louise Casey, which warned some sections of society did not accept British values such as tolerance.
He said he was “drawn” to Dame Louise’s recommendation to bring in an oath of allegiance because it was impossible for people to play a “positive role” in public life unless they accepted basic values like democracy and equality.
Writing in The Sunday Times, Mr Javid said: “If we are going to challenge such attitudes, civic and political leaders have to lead by example.
“We can’t expect new arrivals to embrace British values if those of us who are already here don’t do so ourselves, and such an oath would go a long way to making that happen.”
Mr Javid said his aim was not to create a “government-approved one size fits all identity” where everybody listens to the Last Night of the Proms, but “without common building blocks of our society, you’ll struggle to play a positive role in British life”.
The oath could include phrases such as “tolerating the views of others even if you disagree with them”, as well as “believing in freedom of speech, freedom of religion, freedom from abuse ... a belief in equality, democracy, and the democratic process” and “respect for the law, even if you think the law is an ass”.
Mr Javid also wants all migrants to swear an oath of allegiance, not just those seeking UK citizenship, The Sunday Times said.
Dame Louise’s report warned the country was becoming more divided as it became more diverse and highlighted that in some communities women were the subject of “abuse and unequal treatment of women enacted in the name of cultural or religious values”.
In her report she acknowledged that elements would be “hard to read”, particularly for Muslim communities which already felt under pressure, but she said the country had to face up to “uncomfortable” problems.
The review recommended that schoolchildren should be taught “British values” of tolerance, democracy and respect to help bind communities together amid growing “ethnic segregation”.
The review was originally commissioned by then prime minister David Cameron in 2015 as part of a wider strategy to tackle the “poison” of Islamic extremism.
It found that while Britain had benefited hugely from immigration and the increased ethnic and religious diversity it had brought, there had not been sufficient emphasis on integration.