Nugroho Nurhayoto, police chief of Binjai district in Langkat regency, where the accident took place, said the victims were trapped with no way out.
He added that they were suspected to be locked inside the factory.
The 30 bodies have been recovered from the site and sent to the Bhayangkara Police Hospital in Medan for autopsies.
Among the casualties, three were children who had accompanied their mothers to work.
The police are investigating the cause of the deadly blaze.