In this study, the oxidized cellulose nanofibrils from pineapple peel (PP-TOCNF) were prepared by TEMPO-mediated oxidation followed by ball milling. The influence of oxidation degree on the structure and properties of PP-TOCNF were investigated, including Fourier transform infrared spectroscopy , X-ray diffraction, atomic force microscope (AFM), X-ray photoelectron spectroscopy and thermogravimetry, as well as the potential application in aerogels. The results suggested that TEMPO oxidation facilitated the dispersion of PP-TOCNF due to the strong electrostatic repulsion between –COO− groups. Regulating oxidation degree by varying NaClO concentration could effectively adjust the –COO− content (0.167–0.550 mmol/g), zeta potential (− 18 to − 34 mV) and rheological properties. The obtained PP-TOCNF showed a long fibrillar structure, whose average diameter and CrI values gradually decreased with the increase of oxidation degree. The PP-TOCNF-based aerogels exhibited a light weight, good porosity, water absorption, and mechanical properties, which also can be easily adjusted by oxidation degree of PP-TOCNF. Furthermore, TEMPO oxidation improved the stability and shape recovery ability of aerogels in water.Graphical abstract: