Abstract. Snow depth data time series are valuable for climatological and hydrological applications. Passive microwave (PMW) sensors are advantageous for estimating spatially and temporally continuous snow depth. However, PMW estimate accuracy has several problems, which results in poor performances of traditional snow depth estimation algorithms. Machine learning (ML) is a common method used in many research fields, and its early application in remote sensing is promising. In this study, we propose a new and accurate approach based on the ML technique to estimate real-time snow depth and reconstruct historical snow depth from 1987–2018. First, we trained the random forest (RF) model with advanced microwave scanning radiometer 2 (AMSR2) brightness temperatures (TB) at 10.65, 18.7, 36.5 and 89 GHz, land cover fraction (forest, shrub, grass, farm and barren), geolocation (latitude and longitude) and station observation from 2014–2015. Then, the trained RF model was used to retrieve a reference dataset with 2012–2018 AMSR2 TB data as the accurate snow depth. With this reference snow depth dataset, we developed the pixel-based algorithm for the Special Sensor Microwave/Imager (SSM/I) and Special Sensor Microwave Imager Sounder (SSMI/S). Finally, the pixel-based method was used to reconstruct a consistent 31-year daily snow depth dataset for 1987–2018. We validated the trained RF model using the weather station observations and AMSR2 TB during 2012–2013. The results showed that the RF model root mean square error (RMSE) and bias were 4.5 cm and 0.04 cm, respectively. The pixel-based algorithm’s accuracy was evaluated against the field sampling experiments dataset (January–March, 2018) and station observations in 2017–2018, and the RMSEs were 2.0 cm and 5.1 cm, respectively. The pixel-based method performs better than the previous regression method fitted in China (RMSEs are 4.7 cm and 8.4 cm, respectively). The high accuracy of the pixel-based method can be attributed to the spatial dynamic retrieval coefficients and accurate snow depth estimates of the RF model. Additionally, the 1987–2018 long-term snow depth dataset was analyzed in terms of temporal and spatial variations. On the spatial scale, daily maximum snow depth tends to occur in Xinjiang and the Himalayas during 1992–2018. However, the daily mean snow depth in Northeast China is the largest. For the temporal characteristics, the February mean snow depth is the thickest during snowy winter seasons. Interestingly, the January mean snow depth represents the annual mean snow depth, which plays an important role in snow depth prediction and hydrological management. In conclusion, through step-by-step validation using in situ observations, our pixel-based approach is available in real-time snow depth retrievals and historical data reconstruction.