(Bloomberg) -- As many as 800 million workers worldwide may lose their jobs to robots and automation by 2030, equivalent to more than a fifth of today’s global labor force.

That’s according to a new report covering 46 nations and more than 800 occupations by the research arm of McKinsey & Co.

The consulting company said Wednesday that both developed and emerging countries will be impacted. Machine operators, fast-food workers and back-office employees are among those who will be most affected if automation spreads quickly through the workplace.

Even if the rise of robots is less rapid, some 400 million workers could still find themselves displaced by automation and would need to find new jobs over the next 13 years, the McKinsey Global Institute study found.

The good news for those displaced is that there will be jobs for them to transition into, although in many cases they’re going to have to learn new skills to do the work. Those jobs will include health-care providers for aging populations, technology specialists and even gardeners, according to the report.

“We’re all going to have to change and learn how to do new things over time,” Michael Chui, a San Francisco-based partner at the institute, said in an interview.

Bloomberg News