Ammonium polyphosphate is an inorganic salt of polyphosphoric acid and ammonia containing both chains and possibly branching. Its chemical formula is [NH4 PO3]n showing that each monomer consists of an orthophosphate radical of a phosphorus atom with three oxygens and one negative charge neutralized by an ammonium anion leaving two bonds free to polymerize. In the branched cases some monomers are missing the ammonium anion and instead link to three other monomers.
The properties of ammonium polyphosphate depends on the number of monomers in each molecule and to a degree on how often it branchs. Shorter chains are more soluble less theramlly stable.