Time synchronization is a critical topic in wireless sensor networks for its wide applications, such as data fusion, TDMA scheduling and cooperated sleeping, etc. In this paper, we present an accurate time synchronization (ATS) algorithm using linear least square for sensor networks. Unlike the previous protocols, all nodes aren’t synchronized to some reference nodes or sink node, but to a virtual clock. Moreover, each pair of the nodes are synchronized each other. The main advantage of ATS is simple and accurate. The variance of the synchronized drift error is no more than D
, where D
is the depth of the network,
is the maximal variance of the link delay and
is the sampling interval. The experiments show the high precision compared with the previous algorithms.