The present study examines the distribution and habitat selection of Indian flying fox, Pteropus medius in Uttar Pradesh, India. A through field work conducted across six districts revealed 22 roosting locations with a total population of approximately 12,023 bats. These sites were located at rural (12), semi-urban (2), urban (1), agricultural (5), and industrial (2) areas, and a majority of roost sites observed close to human habitations. Pteropus medius preferred to roost on 20 species of trees which indicate wide-ranging habitat preferences. Although there were considerable differences in tree attributes across different species, such as tree height (ranging from 9.54 to 26.03 meters), canopy width (varying from 8.59 to 25.09 meters), crown height (ranging from 1.19 to 18.90 meters), circumference (ranging from 0.54 to 3.65 meters), and DBH (ranging from 0.17 to 3.73 meters), and there was no notable variation in bat occupancy per roost tree. The results of the regression analysis emphasized the significance of canopy width as a predictor of colony size, indicating its importance in identifying suitable roosting habitats for P. medius. ANOVA analysis indicated differences in tree characteristics across species, highlighting the necessity for through habitat evaluations. Subsequent post-hoc examination clarified distinct clusters of tree species with significant variations in roosting site features. These results underscore the intricate relationship between tree attributes and bat populations, emphasizing the significance of well-informed conservation approaches for the sustainable preservation of P. medius and the overall ecosystem well-being.