"In total 47 people died".
Tangerang police chief Hary Kurniawan says the death toll could rise further as numerous dozens of injured have extensive burns.
The factory, run by PT Panca Buana Cahaya Sukses, had operated for only six weeks, district chief Toni Rustoni said.
Parts of the building collapsed after being gutted by the blaze, which scorched nearby cars and motorbikes.
Locals heard two explosions from the factory and saw smoke coming the building's roof, the Kompas.com news outlet reported.
The fire has been brought under control. "We are going to search whether there are any victims that need immediate treatment at hospitals".
Some relatives wept openly outside the hospital as victims, covered in bandages, were laid out in stretchers, while others with minor injuries sat in the hospital's hallways or outside. Yuwono said an emergency exit had been locked, preventing workers from escaping, and many charred remains were found in a pile.
Officials said most of the injured workers were in the warehouse area of the factory, which has been operating for only two months.
Industrial safety standards in Indonesia are often low and rules poorly enforced.