Summary Intermittent fasting (IF) is a nutritional lifestyle intervention with broad metabolic benefits, but whether the impact of IF depends on the individual’s age is unclear. Here, we investigated the effects of IF on systemic metabolism and pancreatic islet function in old, middle-aged, and young mice. Short-term IF improved glucose homeostasis across all age groups, without altering islet function and morphology. In contrast, while chronic IF was beneficial for adult mice, it resulted in impaired β-cell function in the young. Using scRNAseq, we delineated that the β-cell maturation and function score were reduced in young mice. In human islets, a similar pattern was observed in Type 1 (T1D), but not in Type 2 diabetes (T2D), suggesting that the impact of chronic IF in adolescence is linked to the development of β-cell dysfunction. Our study suggests considering the duration of IF in younger people, as it may enhance rather than reduce diabetes outcomes. Graphical abstract Long-term IF impairs β-cell function in adolescent mice. IF-induced impaired β-cell function is associated with impaired proliferative capacity and lower levels of mature cells. IF-induced impaired β-cell function is associated with a transcriptional change highly conserved in type 1-, but not type 2 diabetes.