Anti-swelling hydrogels have been used as underwater sensors, underwater actuators and artificial biomimetic cartilage. In order to improve the anti-swelling property, most hydrogels introduce environment-unfriendly chemical crosslinkers or organic solvents into the polymer network to enhance the crosslinking density of the network, which limits their application in the body. Therefore, we settled a dense hydrogen-bond network by introducing hyperbranched amylopectin (Amy) into polyvinyl alcohol (PVA) to prepare a non-toxic, biocompatible, tough hydrogel sensor. In addition, the hydrogels exhibit significant anti-swelling performance in various liquid media (such as swelling rates = 3.55%, in seawater) and excellent mechanical properties due to strong intermolecular hydrogen bond between Amy and PVA as well as the salting-out effect induced by sodium chloride (NaCl). Moreover, the hydrogels show moderate sensitivity (GF = 4.96), rapid response, signal stability and negligible hysteresis, which can be used to detect a variety of physiological signals and human movements. More significantly, the hydrogels have excellent biocompatibility and potential application prospects in the implantable sensors and medical fields.