Aminoglycosides are a family of critically important antibiotics for the treatment of serious infections including multidrug-resistant pathogens. However, clinical use of aminoglycoside antibiotics is compromised by bacterial biofilm formation at subinhibitory concentrations or adverse side effects such as ototoxicity and nephrotoxicity at high antibiotic doses. Preparation of aminoglycoside formulation that allows on-demand drug delivery is a solution to this sticky issue. Here, we designed a new type of aminoglycoside hydrogels by cross-linking oxidized polysaccharides such as dextran, carboxymethyl cellulose, alginate, and chondroitin using aminoglycosides as cross-linkers. The hydrogel modulus, degradation rate and release kinetics can be precisely modulated by tailoring the aminoglycoside dose during gel formation. The aminoglycoside hydrogel showed fast gelation, self-healing and on-demand drug release behaviors, and high antibacterial activities in vitro and in vivo against both Gram-positive and Gram-negative bacteria. This study provides a facile and promising strategy to develop smart hydrogels for topical administration of aminoglycoside antibiotics.