Predicting soil heavy metal (SHM) content is crucial for understanding SHM pollution levels in urban residential areas and guide efforts to reduce pollution. However, current research indicates low SHM prediction accuracy in urban areas. Therefore, we employed a deep learning method (fully connected deep neural network) alongside four other methods (muti-layer perceptron, radial basis function neural network, multiple stepwise linear regression, and Kriging interpolation) to predict SHM content in the urban residential areas of Beijing and demonstrated the strength of deep learning in improving prediction accuracy. We found the contents of the evaluated heavy metals (Cd, Cu, Pb, and Zn) exhibited significant correlations with numerous other soil physicochemical properties and environmental factors. The prediction accuracy for Cu, Pb, and Zn contents was relatively high across different methods. Notably, deep learning showed considerable strength in predicting the contents of the four heavy metals, with the R