England is to move to level zero of Covid restrictions on 19 July, but mandatory use of face coverings is to remain in place on Transport for London (TfL) services, unless exempt.
This includes the Tube, bus, tram, DLR, Overground and TfL Rail.
TfL staff and bus drivers will continue to remind passengers that masks are a requirement, Sadiq Khan said.
It is the first English city to insist on face coverings after Covid restrictions ease.
But the Mayor of Greater Manchester Andy Burnham has said he will not '"rule out" mandating face masks on public transport.
Mr Burnham told the BBC he hadn't yet taken the decision to mandate masks on trams in Manchester and wanted to avoid adding to people's confusion.
And in Scotland the mandatory use of face coverings will remain in place for "some time", First Minister Nicola Sturgeon has said, even after the country eases most of its other restrictions on 19 July. The rules for masks apply in shops and public transport - as well as pubs and restaurants when not seated.
Mr Khan said: "I'm not prepared to stand by and put Londoners, and our city's recovery, at risk. This is why, after careful consideration, I have decided to ask TfL to retain the requirement for passengers to wear a face covering on all TfL services when the national regulations change."
Transport for London is the first operator to say that it will make wearing a mask a condition of carriage, unless you're exempt. This is far stronger than just guidance or a suggestion - those without will be denied travel.
The London Mayor has said that as well as suppressing the virus this is also about giving passengers confidence.
Other operators don't feel the same way - many are worried that requiring face masks will make passengers think that public transport is less safe than other indoor settings like pubs and restaurants at a time when they desperately need the numbers on board to go up.
The legal requirement to wear a face covering in shops, public transport and other enclosed public spaces will end on 19 July. It will be replaced with government guidance.
Prime Minister Boris Johnson said the government "expects and recommends" that face coverings are worn in crowded and enclosed spaces.
Labour has said it is "irresponsible" to drop the legal requirement to wear masks.
The move has been welcomed by the RMT union, which represents rail workers. It said the approach was consistent with the rules that are currently in place in Scotland, Wales and on Eurostar services to the continent.
However, it said: "We now have the ludicrous position where a passenger travelling through London will have different rules on the Tube and the mainline services."
From 2 May to 29 May 2021, 86% of TfL customers said they were wearing face coverings at all times on public transport.
Of the 14% not wearing a face covering at all times or not at all, almost three-quarters (74%) claim to have an exemption or good reason under the current regulations for not doing so, TfL research shows.
Andy Byford, London's Transport Commissioner, said: "The transport network is cleaner than ever, with an enhanced cleaning regime, hospital grade cleaning products, widely-available hand sanitizer and UV light fittings on escalator handrails to kill viruses.
"It is great news that regular independent testing for the virus by Imperial College has found no trace on our services, and we are now ready to safely welcome back more and more customers from 19 July as people head out to enjoy all that the capital has to offer."