AbstractHow organisms search for and obtain food is a determinant of their survival. It has been hypothesized that organisms facing food limitations might expand their dietary niche compared with optimal foraging conditions. Nonetheless, some organisms may reduce their dietary niche due to limiting resources. Here, we show the resource use plasticity of capybaras (Hydrochoerus hydrochaeris), the largest living rodent, in natural and anthropized environments of Brazil using stable carbon and nitrogen isotopes in hair. We assessed the resource use, size and overlap of isotopic niches, and the influence of body mass, age class, sex, and landscape composition on isotopic values among 13 capybara populations (210 individuals). We observed a wide variation in isotopic values of capybaras among and within populations in different environments. Surprisingly, diets varied from strictly C4‐based to strictly C3‐based, with most individuals feeding on C4 plants (65%). A substantial portion of individuals presented mixed diets (C3 and C4 plants), totaling 31% of the individuals, and few fed exclusively on C3 plants (4%). Isotopic niche size also varied among populations in both environments, with low overlap considering their core dietary niche. Capybara populations in natural environments had substantial incorporation of C3 resources, showing individuals with strictly C3 diets, and possibly relying on a high diversity of food items, while some populations in anthropized ones fed exclusively on C4 resources. Neither body mass, age class, sex, nor landscape composition significantly influenced isotopic values. Here, we provide evidence of the dietary plasticity of capybaras in different environments, transitioning from the consumption of C4 to C3 plants when needed, that is, from preferred to non‐preferred food items. Together with the species' behavioral plasticity, our results help explain its resilience in surviving, and even thriving, in both natural and human‐modified environments.