Snow density is an essential property of snowpack. To obtain the spatial variability of snow density and estimate it in different periods of the snow season remain challenging, particularly in the mountainous area. This study analysed the spatial variability of snow density with in‐situ measurements in three different periods (i.e., accumulation, stable and melt periods) of the snow seasons of 2017/2018 and 2018/2019 in the middle Tianshan Mountains, China. The simulation performances of the multiple linear regression (MLR) model and three machine learning (random forest [RF], extreme gradient boosting [XGB] and light gradient boosting machine [LGBM]) models were evaluated. Results showed that snow density in the melt period (0.27 g cm−3) was generally greater than that in the stable (0.20 g cm−3) and accumulation periods (0.18 g cm−3), and the spatial variability of snow density in the melt period was slightly smaller compared to that in other two periods. The snow density in the mountainous areas was generally higher than that in the plain or oasis areas. It increased significantly (p < 0.05) with elevation during the accumulation and stable periods. In addition to elevation, latitude and ground surface temperature also had critically impacted the spatial variability of snow density in the study area. In the current study, the machine learning models, especially RF, performed better than MLR for simulating snow density in the three periods. Based on the key environmental variables identified by the machine learning model and correlation analysis, this study also provides practical MLR equations to estimate the spatial variance of snow density during different snow periods in the middle Tianshan Mountains. This method can be used for regional snow mass and snow water equivalent prediction, leading to a better understanding of local snow resources.