By analysing the UWB algorithm based on TOA mode and using the least square location algorithm, the original TOA ranging value is processed, and then the UWB ranging experiment is carried out in the non-line-of-sight environment. It can be found that the least square positioning algorithm adopted in this paper improves the accuracy of UWB ranging to a certain extent, by analysing the experimental data. At the same time, the influence of human shielding on UWB ranging is analysed through concrete experiments, and suggestions on improving the accuracy of UWB ranging are provided.