Though visualizing perspiration constituents is crucial for physiological evaluation, inadequate material healing and unreliable power supply methods restrict its applications. Herein, a fully flexible self-powered sweat sensor is fabricated from a cellulose-based conductive hydrogel to address these issues. The hydrogel electrode is composed of a cellulose nanocomposite polymerized in situ with polyaniline and cross-linked with polyvinyl alcohol/borax. The cellulose nanocomposites furnish the sweat sensor with tensile and electrical self-healing efficiencies exceeding 95% within 10 s, a stretchability of 1530%, and conductivity of 0.6 S m(-1). The sweat sensor quantitatively analyzes Na+, K+, and Ca2+ contents in perspiration, to sensitivities of 0.039, 0.082, and 0.069 mmol(-1), respectively, in real time via triboelectric effect and wirelessly transmits the results to a user interface. This fabricated sweat sensor with high flexibility, stability, and analytical sensitivity and selectivity provides new opportunities for self-powered health monitoring.