In this work, a novel nitrogen-phosphorus co-doped carbon quantum dots (N, P-CQDs) hydrogel was developed utilizing the as-synthesized N, P-CQDs and acrylamide (AM) with the existence of ammonium persulfate and N, N′-methylene bisacrylamide (N-MBA). In consistent with pure N, P-CQDs, the N, P-CQDs hydrogel also shows a dramatic fluorescence property with maximum emission wavelength of 440 nm, which can also be quenched after adsorbing Fe3+. When the concentration of Fe3+ is 0-6 mmol/L, a better linear relationship between Fe3+ concentration and the fluorescence intensities can be easily obtained. Additionally, the N, P-CQDs hydrogel exhibits better recyclability. This confirms that the N, P-CQDs hydrogel can be used for adsorbing and detecting Fe3+ in aqueous with on-off-on mode. The fluorescence quenching mainly involves three procedures including the adsorption of Fe3+ by hydrogel, integration of Fe3+ with N, P-CQDs and the transportation of conjugate electrons in N, P-CQDs to the vacant orbits of Fe3+ and the adsorption process follows a pseudo-second-order kinetic model confirmed in the Freundlich isotherm model. In conclusion, this work provides a novel route for synchronously removing and detecting the metal ions in aqueous by integrating N, P-CQDs with hydrogel with better recyclability.