The TanDEM-X Digital Elevation Model (DEM) is limited by the radar side-view imaging mode, which still has gaps and anomalies that directly affect the application potential of the data. Many methods have been used to improve the accuracy of TanDEM-X DEM, but these algorithms primarily focus on eliminating systematic errors trending over a large area in the DEM, rather than random errors. Therefore, this paper presents the least-squares collocation-based error correction algorithm (LSC-TXC) for TanDEM-X DEM, which effectively eliminates both systematic and random errors, to enhance the accuracy of TanDEM-X DEM. The experimental results demonstrate that TanDEM-X DEM corrected by the LSC-TXC algorithm reduces the root mean square error (RMSE) from 6.141 m to 3.851 m, resulting in a significant improvement in accuracy (by 37.3%). Compared to three conventional algorithms, namely Random Forest, Height Difference Fitting Neural Network and Back Propagation in Neural Network, the presented algorithm demonstrates a reduction in the RMSEs of the corrected TanDEM-X DEMs by 6.5%, 7.6%, and 18.1%, respectively. This algorithm provides an efficient tool for correcting DEMs such as TanDEM-X for a wide range of areas.