Prolonged exposure to ultraviolet (UV) radiation can cause erythema, sunburn, inflammation, and even skin cancer. Sunscreen is highly effective in protecting against UV radiation. Hydrogels, due to their similarity to the skin's extracellular matrix, flexibility, and high water content, have been widely used for sunscreen applications. However, traditional sunscreens may have limitations, including skin irritation, environmental impact, and formulation issues. This study introduces two innovative chitosan-based hydrogel sunscreens integrating 2,4-dihydroxybenzaldehyde (DHBA) and vanillin (VA) as UV absorbers and cross-linkers. The synthesized CS/DHBA and CS/DHBA/VA hydrogels, leveraging a hybrid network of Schiff-base and intermolecular hydrogen bonds, demonstrated exceptional UV-shielding capabilities with broad absorption of UVB and UVA regions (290-400 nm). Furthermore, the hydrogels exhibited a porous three-dimensional interconnected microstructure with self-healing and potent antioxidant properties. In vitro sun protection factor values and in vivo experiments confirmed the efficacy of the hydrogel sunscreens for robust UV protection. Importantly, in vivo skin toxicity assessments established the safety of the hydrogels for skin application. The multifunctional nature of the chitosan-based hydrogel sunscreens, coupled with UV-shielding properties, underscores their potential as a valuable biomaterial for skin protection. These findings show great promise for improving sunscreen technology and offer a pathway for developing next-generation UV-protective skincare products.