Police said the 41-year-old suspect broke into the Kyoto Animation studio on Thursday morning and sprayed petrol before igniting it.
The suspect has been detained and was taken to hospital with injuries.
Japan's Prime Minister Shinzo Abe said the incident was "too appalling for words" and offered condolences.
It is one of Japan's worst mass casualty incidents since World War Two.
Kyoto Animation, known as KyoAni, produces films and graphic novels, and is well regarded by fans for the quality of its productions.
How did the incident unfold?
The fire broke out at the three-storey building at about 10:30 local time (01:35 GMT) on Thursday. Rescue operations are still ongoing.
Police also found knives at the scene, say local media. Public broadcaster NHK said the man had been heard saying "drop dead" as he set fire to the building.
The suspect's relationship with the company is unclear.
Eyewitnesses described a loud explosion followed by an inferno that rapidly engulfed the building.
"I saw some people with burns, covered with something. They were rushed to the ambulance," one neighbour said.