The government fears sensitive data held on official phones could be accessed by the Chinese government.
Cabinet Minister Oliver Dowden said the ban was a "precautionary" move but would come into effect immediately.
TikTok has strongly denied allegations that it hands users' data to the Chinese government.
Theo Bertram, the app's vice-president of government relations and public policy in Europe, told the BBC it believed the decision was based on "more on geopolitics than anything else".
"We asked to be judged not on the fears that people have, but on the facts," he added.
The Chinese embassy in London said the move was motivated by politics "rather than facts" and would "undermine the confidence of the international community in the UK's business environment".
Mr Dowden said he would not advise the public against using TikTok, but they should always "consider each social media platform's data policies before downloading and using them".
Prime Minister Rishi Sunak had been under pressure from senior MPs to follow the US and the European Union in barring the video-sharing app from official government devices.
But government departments - and individual ministers - have embraced TikTok as a way of getting their message out to younger people.
Use of the app has exploded in recent years, with 3.5 billion downloads worldwide.
Its success comes from how easy it is to record short videos with music and fun filters, but also from its algorithm which is good at serving up videos which appeal to individual users.
It is able to do this because it gathers a lot of information on users - including their age, location, device and even their typing rhythms - while its cookies track their activity elsewhere on the internet.
US-based social media sites also do this but TikTok's Chinese parent company ByteDance has faced claims of being influenced by Beijing.
Downing Street - which last posted a TikTok video of Larry the Cat predicting football results - said it would continue to use TikTok to get the government's message out. It said there were exemptions to the ban under some circumstances.
Some politicians are also reluctant to give up the TikTok habit, despite the security warnings.
Cabinet minister Grant Shapps - an enthusiastic TikTokker - reacted to the ban by posting a clip from the film, Wolf Of Wall Street, in which Leonardo DiCaprio, playing a New York stockbroker, uses a series of expletives and declares: "The show goes on".
Mr Shapps called the ban "sensible", but added: "I've never used TikTok on government devices and can hereby confirm I will NOT be leaving TikTok anytime soon!"
Ministers have not been banned from using the site on their personal phones - just their work devices.
But Nadine Dorries - who experimented with TikTok videos when she was culture secretary - said she would be deleting the app from her personal phone, adding: "I think all MPs should do likewise".
Hours before the ban was announced the Ministry of Defence (MoD) uploaded a video of a Challenger 2 tank, a type being supplied to Ukraine, to its TikTok account.
The MoD said it would continue to use the app "to promote the work of the Armed Forces and to communicate our support to Ukraine". The department's sensitive data is "held on a separate system", it added.
The Welsh government has also banned TikTok from the work phones of ministers and civil servants.
In Edinburgh, a spokesperson for the Scottish government said officials were liasing with the Cabinet Office "as we consider the need for further action".
In a statement earlier, TikTok said the UK government's decision was based on "fundamental misconceptions".
"We remain committed to working with the government to address any concerns but should be judged on facts and treated equally to our competitors," a spokesman added.
A handful of Western journalists were found to have been tracked by ByteDance employees. ByteDance says they were fired.
A US TikTokker shared a video criticising the Chinese government's treatment of the Uighur Muslims, and it was taken down. TikTok said this was a mistake.
This has added to the nervousness of governments and security specialists - despite the firm's consistent denials.
The Chinese state demands loyalty from all businesses based in the country and nobody really knows to what extent ByteDance might be pushed to comply with demands for data.
The United States barred TikTok from official devices in December, and the European Commission followed suit last month. Canada, Belgium and India have taken similar action.
China has accused the US of spreading disinformation and suppressing TikTok amid reports the White House wants its Chinese owners to sell their stakes in the firm.
TikTok insists it does not share data with Chinese officials, but Chinese intelligence laws requires firms to help the Communist Party when requested.
Western social media apps such as Facebook, Instagram and Twitter are blocked in China.