Firmiana danxiaensis is an endemic species of Danxia landform in China. Identifying the main driving factors of its distribution can provide scientific basis for the conservation of F. danxiaensis and related habitats. With GeoDetector, we analyzed the correlation (measured by q value) between the spatial distribution of F. danxiaens and its habitat factors in F. danxiaens Nature Reserve in Nanxiong City and the Guangdong Danxia Mountain Tourism Scenic Area (core scenic area). Factors measured in this study included geographical elements (geomorphological type, soil subtype, elevation, slope, aspect) and climatic elements (annual precipitation and annual sunshine hours, mean annual relative humidity and mean annual wind speed). Our results showed that the main habitat factors affecting the spatial distribution of F. danxiaensis were soil subtype, annual sunshine hours, and geomorphologic genesis type. The q values of those three factors were higher than the mean values of all factors. In the pairwise combination of habitat factors, the interaction between geomorphologic genesis types ∩ annual sunshine hours and soil subtypes ∩ annual sunshine hours was enhanced by two factors and the q value was greater than the mean value of all combinations, with a strong correlation. Compared with other factors, the q value of soil subtypes, annual sunshine hours and geomorphologic genesis types were significantly different in the ecological detection of spatial distribution correlation of F. danxiaensis. The spatial distribution of F. danxiaensis was significantly correlated with soil subtypes, geomorphologic genesis types and annual sunshine hours, indicating that the GeoDetector is a useful method for vegetation habitat factor analysis and species distribution prediction.