Understanding the impact of climate change on crop yields is critical to ensure global food sustainability. This study quantifies the spatiotemporal variation and trend changes in wheat yield from 1999 to 2018. Additionally, the impacts of climate change scenarios on wheat yield were predicted using two emission scenarios (SSP45 and SSP85) from global climate models (GCMs) and machine learning (ML) algorithms. Results showed that climate variability is more prominent during the winter wheat growing season, yet yield variability is higher for spring wheat, with coefficients of variation ranging from 0.06–0.25 for spring wheat and 0.02–0.09 for winter wheat. Distinct variances are manifested in the trends of climate variables throughout the growth durations of spring wheat and winter wheat. Notably, spring and winter wheat yields show upward trends, increasing by 55.3 kg ha–1 a–1 and 32.1 kg ha–1 a–1, respectively. However, the yield trend variations driven by climatic factors are relatively low. The Random Forest (RF) model provides the best wheat yield prediction among the five ML models. Precipitation, Tmean, and sunshine hours are ranked as the three most influential climate variables affecting spring wheat yields, with respective characteristic importance of 0.375, 0.189, and 0.160. For winter wheat, the most significant factors are precipitation, Tmin, and Tmax, with characteristic importance of 0.317, 0.274, and 0.155, respectively. In the future, spring wheat and winter wheat will face higher temperatures, increased precipitation, and reduced sunshine duration during their growing seasons. Under the SSP45 and SSP85 scenarios, the spring wheat yield in the future period (2030–2060) is projected to increase compared to the historical period, with an average change rate of 4.6 % (6.4 %). In contrast, the winter wheat yield is expected to decrease, with an average change rate of −3.9 % (−4.8 %). These findings highlight the need for adaptive measures, such as enhanced water management, optimized sowing dates, and improved soil quality, to support resilient wheat production and sustainable development in Xinjiang or similar arid areas amid climate change.