Focusing on the accuracy of target locating in wireless sensor networks, a target locating algorithm based on curve-fitting is proposed. With least square fitting to the positions of all targets, the curve parameters of the approximate target traveling path are calculated. Moreover, more localization information is introduced to participate in target locating via piecewise curve fitting, thus erroneous factor is reduced in the process of localization. Finally, the localization and tracking of the target is realized. Test results indicate that the proposed algorithm brings higher target locating precision than general curve fitting method, thus the accuracy of target locating in wireless sensor networks can be improved effectively.