The move follows campaigning by Theirworld and other organisations to let children go to school without the fear of being attacked.
Every day, children in conflict-torn countries face the threat of their schools being attacked, bombed or occupied by military forces.
Schools should be safe spaces where children can learn, recover from trauma and be with their friends and teachers.
More countries are recognising that - and the United Kingdom has become the 74th nation to sign the Safe Schools Declaration. It is a commitment, established in 2015, to protect education and stop the military use of schools.
British Foreign Secretary Boris Johnson announced the move yesterday after accepting a petition from supporters of Theirworld, Global Citizen and Send My Friend to School as the Commonwealth Heads of Government meetings were being in London.
Theirworld has been campaigning for all five permanent members of the United Nations Security Council to sign the declaration. France showed leadership by signing last year - but the United States, Russia and China have still to back it.
Ben Hewitt, Theirworld's Director of Campaigns, said: "Every child has the right to go to a safe school without fear of attack.
"The UK signing the Safe Schools Declaration, along with 73 other countries, is an important step in the campaign to make sure schools are never used for military purposes."
Diya Nijhowne, director of the Global Coalition to Protect Education from Attack, said: “The UK’s endorsement of the Safe Schools Declaration represents a doubling of countries that have signed on in under three years.
"With the UK, this includes 14 Commonwealth countries that have joined the Declaration. Such momentum should serve as a clarion call for the remaining Commonwealth members to unite in these crucial efforts to protect students and educators living in conflict zones.”
The UK also announced this week it will provide almost $300 million in aid money to help 920,000 vulnerable girls across the Commonwealth receive 12 years of quality education by 2030.
International Development Secretary Penny Mordaunt said: “Getting girls into school, and then into good employment, allows them to play a transformational role lifting their communities out of poverty, growing their economies and shaping the future of their countries.”
About 140 million children in the Commonwealth are not in school.