A high-sugar diet has been associated with reduced lifespan in organisms ranging from worms to mammals. However, the mechanisms underlying the harmful effects of glucose are poorly understood. Here we establish a causative relationship between endogenous glucose storage in the form of glycogen, resistance to oxidative stress and organismal aging in Caenorhabditis elegans. We find that glycogen accumulated on high dietary glucose limits C. elegans longevity. Glucose released from glycogen and used for NADPH/glutathione reduction renders nematodes and human hepatocytes more resistant against oxidative stress. Exposure to low levels of oxidants or genetic inhibition of glycogen synthase depletes glycogen stores and extends the lifespan of animals fed a high glucose diet in an AMPK-dependent manner. Moreover, glycogen interferes with low insulin signalling and accelerates aging of long-lived daf-2 worms fed a high glucose diet. Considering its extensive evolutionary conservation, our results suggest that glycogen metabolism might also have a role in mammalian aging.