A nonhalogenated and ecofriendly flame-retarding material was developed using lignin, one of the main components of lignocellulosic biopolymers. Lignin was purified, dissolved, and formulated as nanoparticles and implemented after processing in an ecofriendly water-based γ-valerolactone (GVL) system at different concentrations. Nitrogen‑phosphorus sequential chemical modification was performed using polyethyleneimine (PEI) and phytic acid (PA), The char residue increased by ≥10 % compared with lignin nanoparticles (LNPs). A 10 wt% lignin-based flame retardant (L-FR) based on the weight of cotton fabric was introduced using a simple dipping method. Compared to existing cotton fabrics, the combustion time of L-FR treated cotton fabrics was reduced by 6.8 s. The maximum flame height was reduced by 5.4 cm, and the charcoal residue increased by 25 %. The flame-retarding mechanism of L-FR involved low-temperature dehydration, thermal decomposition of cellulose by the phosphorus component of PA and generation of expansive gas by the nitrogen component of PEI. These results showed that lignin-based raw material processing, polymer processing, and chemical modification were biomass-based, suggesting that lignin could be converted into an ecofriendly flame retardant, highlighting the feasibility of high-value-added lignin.