Fluorescent hydrogels have recently attracted great attention for medical diagnostics, bioimaging and environmental monitoring. However, additional phosphors or fluorophores are always required to label the hydrogels, and they suffer from marker bleaching, signal drifts, or information misrepresentation. Here we report autofluorescence that universally exists in carbonyl-containing hydrogels without any traditional fluorophore. The fluorescence is successfully employed to self-monitor the gelation process since the fluorescence signal is closely related to the internal structural change of the gels. The crosslinked structure is beneficial to the fluorescence efficiency. Specifically, the fluorescence intensity is amplified with decreasing water content of the gels. The system realizes aggregation-induced emission in a water-deficient environment. The fluorescence is quenched by the addition of some specific metal ions, which can realize the successfully erasure and rewriting of information under visible light and ultraviolet light respectively. We believe that the spontaneous fluorescence of a gel provides the most reliable basis for the detection of a gel structure and opens new prospects in the application of hydrogels.