3D topography metrology of optical micro-structured surfaces is critical for characterizing surface texture and form errors. The coherence scanning interferometry (CSI) faces many challenges for improving the accuracy of 3D topography metrology. In this paper, the least-squares (L-S) phase-shifting algorithm of coherence scanning interferometry with windowed B-spline fitting, resampled and subdivided phase points is proposed, which provides high accuracy of 3D surface topography. The proposed algorithm avoids the introduction of complex judgment criterion of fringe orders, and tedious phase unwrapping. Comparison with generalized phase-shifting algorithm, the wrong textures do not appear on the reconstructed 3D surfaces and 2D profiles for optical grating and Micro-lens array (MLA) surfaces using the proposed algorithm. Experimental results show that a VLSI step surface has high repeated measurement accuracy with a standard deviation of 1.6 nm, the periodic error of the proposed algorithm for PMMA MLA sub-aperture units is about 20 nm, and the mean value of PMMA MLA four random sub-aperture units are 6.66 nm (Sq), 77.63 nm (Sp), 36.38 nm (Sv), 114.18 nm (Sz) and 4.90 nm (Sa), respectively.