In sensor networks, the information obtained from sensors will be meaningless without the location information. In this paper, we propose a simulated annealing based localization (SAL) scheme for wireless sensor networks. Simulated annealing (SA) is used to estimate the approximate solution to combinatorial optimization problems.The SAL scheme can bring the convergence out of the local minima in a controlled fashion. Simulation results show that this scheme gives accurate and consistent location estimates of the nodes.