AbstractAnimals are known for their self‐medicating behavior, and food composition also contributes to animal fitness. In this study, we investigated the dietary habits of endangered Chinese crocodile lizards and found that, compared to adult lizards, juvenile lizards consumed more centipedes, a trend validated through controlled feeding experiments. Juvenile lizards fed with centipedes demonstrated faster growth rates and better body conditions than those fed an earthworm‐only diet, despite no increase in food intake. The centipede‐added group showed lower species richness in the gut microbiome and had more abundant fermentative bacteria, such as Bacteroides, Paraclostridium, and Enterococcus, whereas the earthworm‐only group had more abundant non‐fermentative opportunistic pathogens. Higher concentrations of short‐chain fatty acids, which are mainly derived from bacterial fermentation in the gut, were found in the feces of the centipede‐added group. Therefore, consumption of centipedes promoted the growth and gut microbiota homeostasis of juvenile lizards. This study emphasizes the significance of preserving food diversity in natural environments and increasing dietary diversity in captive populations.