"While the terrorists imposed their burden of grief and suffering, and while the threat persists today, we can now say with the perspective of 20 years that they failed to shake our belief in freedom and democracy," Johnson said in the video message.
"They failed to drive our nations apart, or cause us to abandon our values, or to live in permanent fear."
The message will be played at an event held in London's Olympic Park, where there is a memorial sculpture created from steel salvaged from the collapsed World Trade Center towers.
Al Qaeda head Osama bin Laden plotted the 9/11 attacks from within Afghanistan. That sparked a US-led invasion that swiftly toppled the Taliban government there in 2001, but Western forces remained in the country for another two decades.
Johnson linked the 9/11 anniversary with the recent return of Taliban rule in Afghanistan following the withdrawal of American, British and other NATO forces.
"Recent events in Afghanistan only strengthen our determination to remember those who were taken from us, cherish the survivors and those who still grieve, and hold fast to our belief in liberty and democracy, which will always prevail over every foe," he said.