The acetone present in exhaled breath is a promising indicator for diagnosing human health. The fluorescent hydrogel sensor-based portable sensing platform is a highly effective tool for the on-site detection of acetone. However, existing hydrogel sensors are often limited by their irreversibility and autofluorescence. This study constructed an upconversion nanoprobe with reversibility for dual-mode detection of acetone by simply combining upconversion nanoparticles (UCNPs), hydroxylamine sulfate, and thymol blue (TB). The nanoprobe was further embedded into a hydrogel network to construct the background-free hydrogel nanosensor for the portable detection of acetone. The hydrogel nanosensor utilized long-wavelength-excited UCNPs to avoid self-luminescence interference. Hydroxylamine sulfate, as a specific recognition unit, reacted with acetone to induce the protonation of TB, resulting in an increase in absorbance at 548 nm and a decrease in luminescence at 540 nm, enabling visual colorimetric and precise luminescent detection of acetone. Moreover, the hydrogel nanosensor could be restored to its initial state through the deprotonation of TB, thereby achieving reversible detection. Additionally, 3D printing technology was utilized to construct a portable sensing platform for real-time acetone monitoring. The proposed upconversion hydrogel nanosensor in this study paves a new way for developing hydrogel sensors with high sensitivity and reversibility