Abstract: With the rapid development of wireless sensor networks, the localization algorithms have drawn more attention by researchers. Due to the network cost and the restricted energy of the sensor nodes, most of the localization algorithms are not well suitable for wireless sensor networks and furthermore the positioning accuracy is relatively low. The paper presents a localization algorithm based on Shuffled Frog Leaping Algorithm (SFLA) and Particle Swarm Optimization (PSO). Firstly, a calculation method of average distance per hop was designed by using the shuffled frog leaping algorithm which makes the average distance per hop closer to the actual value. Secondly, we consider the location problem as an optimization process to obtain the position of the unknown nodes positioning using particle swarm optimization algorithm which further precise unknown nodes positions. The simulation results have shown that the proposed location algorithm has a higher accuracy.