Node localization is the basic task of underwater wireless sensor networks (UWSNs). Most of the existing underwater localization methods rely on ranging accuracy. Due to the special environment conditions in the ocean, beacon nodes are difficult to deploy accurately. The narrow bandwidth and high delay of the underwater acoustic communication channel lead to large errors. In order to reduce the ranging error and improve the positioning accuracy, we propose a localization algorithm based on ranging correction and inertial coordination. The algorithm can be divided into two parts, Range Correction based Localization algorithm (RCL) and Inertial Coordination based Localization algorithm (ICL). RCL uses the geometric relationship between the node positions to correct the ranging error and obtain the exact node position. However, when the unknown node deviates from the deployment area with the movement of the water flow, it cannot communicate with enough beacon nodes in a certain period of time. In this case, the node uses ICL algorithm to combine position data with motion information of neighbor nodes to update its position. The simulation results show that the proposed algorithm greatly improves the positioning accuracy of unknown nodes compared with the existing localization methods.