A ban on junk food adverts before the 9pm watershed will come into force at the end of next year, with increased online restrictions also introduced.
The move is part of Boris Johnson’s efforts to tackle obesity, with NHS research showing that almost two-thirds of adults in England are overweight or obese.
But the announcement stops short of a total ban that was proposed last year.
While large fast food and confectionary firms will be banned from advertising foods high in fat, sugar and salt online, small businesses with fewer than 250 employees will be exempt.
Firms will still be able to promote their products on their own websites and social media platforms.
They will also be able to advertise on TV before the watershed, provided they do not show banned foods.
There is an exemption for online audio, which means adverts will be allowed to run on podcasts and radio stations broadcasting online.
In addition, there are exemptions for the healthiest foods within each category, including honey, olive oil, avocados and marmite.
Public health minister Jo Churchill said the move will “help to wipe billions off the national calorie count and give our children a fair chance of a healthy lifestyle”.
“The content youngsters see can have an impact on the choices they make and habits they form. With children spending more time online it is vital we act to protect them from unhealthy advertising,” she said.
“These measures form another key part of our strategy to get the nation fitter and healthier by giving them the chance to make more informed decisions when it comes to food.”
Caroline Cerny, from the Obesity Health Alliance, said the action shows the government is “serious about putting our nation’s health first”.
She said: “Tough new restrictions will stem the flood of adverts on TV and online that entice us towards sugary and high fat foods, making space to advertise healthier foods.”
Barbara Crowther, Sustain’s children’s food campaign co-ordinator, described the measures as “significant step forward in reducing exposure to a constant stream of unhealthy food and drink advertising on TV and online”.
But she added: “We remain concerned that the proposals will still allow massive multinational junk food companies and delivery platforms to run big brand campaigns.
“In short, it’s a very positive step in the right direction, but the journey towards a comprehensive healthier food advertising world is far from over.”
But the Advertising Association said it was “dismayed” by the ban.
Public affairs director Sue Eustace said: “This means many food and drink companies won’t be able to advertise new product innovations and reformulations and larger food-on-the-go, pub and restaurant chains may not be able to tell their customers about their menus.”
She added: “We all want to see a healthier, more active population, but the government’s own analysis shows these measures won’t work.
“Levelling up society will not be achieved by punishing some of the UK’s most successful industries for minimal effect on obesity levels.”
The Food and Drink Federation’s chief scientific officer, Kate Halliwell, said it was a “headline-chasing” move.
“The proposals would make it difficult to advertise many products that have been carefully reformulated or created in smaller portions in line with the government’s own targets; for example, Cadbury would not be able to advertise their 30% reduced sugar Dairy Milk,” she said.
“Not only do the proposals signal a lack of joined-up policy, the implementation periods for both advertising and promotional restrictions do not give businesses enough time to prepare for the changes.”