The nitrite ion (NO2-) is a vital inorganic species that occurs both in natural ecological systems and human bodies. The high concentration of NO2- can be harmful for animal and human health. It is important to develop a simple, sensitive, reliable, and economic methodology to precisely monitor NO2- in various environmental and biological fields. Thus, a novel nitrite biosensor based on carbon quantum dots (PA-CDs) has been constructed and prepared via a high-efficiency, one-pot hydrothermal route using primary arylamines (PA) such as m-phenylenediamine. The device exhibits bright green fluorescence and a high quantum yield of 20.1% in water. In addition, the PA-CDs also possess two broad linear ranges: 0.05-1.0 μM and 1.0-50 μM with a low detection limit of 7.1 nM. The classical diazo reaction is firstly integrated into the PA-CD system by primary arylamines, which endows the system with high sensitivity and specific selectivity towards nitrite. Importantly, the nanosensor can detect NO2- in environmental water and serum samples with high fluorescence recoveries, demonstrating its feasibility in practical applications. This work broadens a new method to fabricate novel nanosensors and provides a prospective application for fluorescent carbon quantum dots (CDs). Graphical abstract.