The aim of this study is to analyze the effects of habitat loss and forest replacement by cattle pasture on the alpha and beta diversity, abundance, biomass and species composition of dung beetles with different dispersal ability. Dung beetles were captured in 19 forest fragments and neighbouring pastures. Forest fragment area ranged from 3.7 to 4825 ha and in this study were grouped into four categories: small, medium, large and control forest. A total of 35,048 dung beetles representing 101 species were collected. Forest fragments had the highest richness with 81 species, followed by pasture with 58 species. Replacement of forest by pasture reduced species richness; however, due to the proximity and connectivity of these areas with Cerrado patches, pastures also had high species richness, but species composition was independent of adjacent fragments. Small fragments had lower abundance and species richness than our other habitat categories, even pastures. Our results highlight that proximity and connectivity with Cerrado areas influenced the patterns of alpha and beta diversity of dung beetles in fragments and pastures. We highlight that the ability to cross the pasture matrix is a strong adaptive trait for species living in human-modified landscapes. Consequently, species with these abilities are less susceptible to the effects of forest fragmentation and local extinction. Our results reinforce the importance of considering the biogeographic location and distribution pattern of species in forest fragmentation studies.