Xinjiang in China is distinguished by its distinctive regional landscape and high ecological sensitivity. Trollius wildflowers represent a unique and iconic element of the mountain flower landscape in Xinjiang. However, their populations are predominantly distributed in mountainous areas, making them susceptible to climate change. Despite this, the impacts of climate change on the distribution of suitable habitats and ecological niche differentiation for Trollius wildflowers have rarely been quantified. Consequently, simulations were conducted using the R-optimized MaxEnt model to predict the suitable habitat distribution of Trollius wildflowers. This was based on the occurrence data and environmental variables for the four species of Trollius (T. altaicus, T. asiaticus, T. dschungaricus, and T. lilacinus) that exist in the study area. The simulation was conducted over a period of time, beginning with the past glacial period and extending to the present, and then to the future (2050s, 2070s, and 2090s) under multiple scenarios (SSP1-2.6, SSP3-7.0, SSP5-8.5). The simulation of suitable habitats enabled the measurement of the ecological niche breadth and differentiation. The results demonstrate that the model predictions are precisely accurate, with AUC values exceeding 0.9. Annual mean temperature (Bio1), isothermality (Bio3), and precipitation in the warmest quarter (Bio18) are the dominant climate variables, in addition to vegetation, elevation, and soil factors. The proportion of suitable habitats for Trollius wildflowers varies considerably over time, from 0.14% to 70.97%. The majority of habitat loss or gain occurs at the edges of mountains, while stable habitats are concentrated in the core of the mountains. The gravity center of suitable habitats also shifts with spatial transfer, with the shifts mainly occurring in a northeasterly-southwesterly direction. The SSP1-2.6 scenario results in the sustained maintenance of habitats, whereas the SSP3-7.0 and SSP5-8.5 scenarios present challenges to the conservation of habitats. The threshold of ecological niche breadth for Trollius wildflowers is subject to fluctuations, while the ecological niche differentiation also varies. The study aims to examine the evolution of the habitat and ecological niche of Trollius wildflowers in Xinjiang under climate change. The findings will provide theoretical support for delineating the conservation area, clarify the scope of mountain flower tourism development and protection of mountain flower resources, and promote the sustainable development of ecotourism and effective utilization of territorial space in Xinjiang.