To improve on the poor strength and flame retardancy of a chitosan (CS)-based functional film, cellulose nanofiber (CNF) was taken as the reinforced material and both ammonium polyphosphate (APP) and branched polyethyleneimine (BPEI) as the flame-retardant additives in the CS matrix to prepare the CS/CNF/APP/BPEI composite film by simple drying. The resulting composite film showed good mechanical strength, with a tensile strength reaching 71.84 Mpa due to the high flexibility of CNF and the combination of CS, CNF and BPEI through strong hydrogen bonding interactions. The flame retardant-performance of the composite film greatly enhanced the limit oxygen index (LOI), up to 32.7% from 27.6% for the pure film, and the PHRR intensity decreased to 28.87 W/g from 39.38% in the micro-scale combustion calorimetry (MCC) test due to the ability of BPEI to stimulate the decomposition of APP, releasing non-flammable gases such as CO2, N2, NH3, etc., and forming a protective phosphating layer to block the entry of O2. Based on the good flame retardancy, mechanical strength and transparency, the CS/CNF/APP/BPEI composite film has a great potential for future applications.