.Urban buildings significantly influence land surface temperature (LST) by modifying heat exchanges due to their 3D structures. Our study calculates six three-dimensional building form (3DBF) indicators in grid cells. They include average height (AH), average volume (AV), building structure index (BSI), floor area ratio (FAR), fluctuation degree (FD), and spatial congestion degree (SCD). Two spatial regression models: spatial lag model (SLM) and spatial error model (SEM), along with three machine learning regression models: support vector regression (SVR), random forest (RF) regression, and artificial neural network (ANN) regression were used in our study. We investigated the qualitative and quantitative effects of urban building 3DBF on Beijing’s primary urban region’s thermal environment. The seasonal relationship between 3DBF indicators and LST was also examined. The ideal grid scale for investigating the impact of 3DBF on LST in Beijing is 200 m. Both SEM and RF regression models exhibit superior performance. The SLM model exhibits superior performance compared to the ANN and SVR models, which demonstrate comparatively poorer results. An increase in AH and AV often results in a decrease in LST, but a higher SCD is associated with an increase in LST. Seasonal variability affects the relationship between BSI and FD on LST. The relationship between FAR and LST does not exhibit a uniform and predictable pattern. In the SEM, the variables of SCD, FD, and AV exhibit a stronger impact on LST. The BSI, AV, and SCD variables are crucial factors in the building of the RF regression model. The cooling effects of AV and AH exhibit their maximum intensity during the summer season, with values reaching up to 1.1°C and 0.5°C, respectively. In winter season, the cooling impact of AH and the warming impact of SCD are notably evident, reaching maximum values of 0.8°C and 0.6°C, respectively.