At present, nodes localization in wireless sensor networks are one of the focuses of many scholars' research. But now the current localization algorithms usually face the problems of low localization accuracy and high computation. Since the information captured by wireless sensor networks is essentially nonlinear, thus this paper proposes a localization algorithm based on manifold learning algorithm local tangent space alignment for wireless sensor networks. It can process nonlinear data to achieve good positioning effect, and the variables in the algorithm have little impact on the localization effect. Two types of positioning data are considered for localization: the measurement distance and the signal strength between sensor nodes. Firstly, the local k-neighborhoods of the localized data points can be found for determining the low-dimensional geometric structure of their local tangent spaces by principal component analysis. Next, the local tangent space of the localized sample points is aligned to obtain the relative locations of the sensor nodes. Then, the physical locations of the sensor nodes can be get by lining up the relative positions with anchor points. Finally, the ending of the paper by doing simulation experiments demonstrate that the algorithm has good precision and few variables in performing nodes localization.