Multiple lineages of bats have evolved striking facial and body pelage makings, including spots, stripes and countershading. Although researchers have hypothesized that these markings mainly evolved for crypsis, this idea has never been tested in a quantitative and comparative context. We present the first comparative study integrating data on roosting ecology (roost type and colony size) and pelage coloration patterns across bats, and explore the hypothesis that the evolution of bat pelage markings is associated with roosting ecologies that benefit from crypsis. We find that lineages that roost in the vegetation have evolved pelage markings, especially stripes and neck collars, which may function in crypsis through disruptive coloration and a type of countershading that might be unique to bats. We also demonstrate that lineages that live in larger colonies and are larger in size tend not to have pelage markings, possibly because of reduced predation pressures due to the predator dilution effect and a lower number of potential predators. Although social functions for pelage color patterns are also possible, our work provides strong support for the idea that roosting ecology has driven the evolution of pelage markings in bats.