Captive specimens in museum collections facilitate study of rare taxa, but the lifestyles, diets, and lifespans of captive animals differ from their wild counterparts. Trabecular bone architecture adapts to in vivo forces, and may reflect interspecific variation in ecology and behavior as well as intraspecific variation between captive and wild specimens. We compared trunk vertebrae bone microstructure in captive and wild xenarthran mammals to test the effects of ecology and captivity. We collected μCT scans of the last six presacral vertebrae in 13 fossorial, terrestrial, and suspensorial xenarthran species (body mass: 120 g to 35 kg). For each vertebra, we measured centrum length; bone volume fraction (BV.TV); trabecular number and mean thickness (Tb.Th); global compactness (GC); cross‐sectional area; mean intercept length; star length distribution; and connectivity and connectivity density. Wild specimens have more robust trabeculae, but this varies with species, ecology, and pathology. Wild specimens of fossorial taxa (Dasypus) have more robust trabeculae than captives, but there is no clear difference in bone microstructure between wild and captive specimens of suspensorial taxa (Bradypus, Choloepus), suggesting that locomotor ecology influences the degree to which captivity affects bone microstructure. Captive Tamandua and Myrmecophaga have higher BV.TV, Tb.Th, and GC than their wild counterparts due to captivity‐caused bone pathologies. Our results add to the understanding of variation in mammalian bone microstructure, suggest caution when including captive specimens in bone microstructure research, and indicate the need to better replicate the habitats, diets, and behavior of animals in captivity.