One key requirement for wireless networks (WNs) is location information. GPS as standard localization approach can often not be used in WNs, mainly due to the high energy consumption of the receivers and its limited use in indoor-type scenarios. Localizing the WN nodes by means of the network itself has been considered as an effective solution to the positioning problem. One approach is cooperative localization that is based on internode time-of-flight measurements. Time measurements are collected during standard packet based communication, and leverage the close relation of the synchronization and the positioning problem. The goal of this thesis is to design and develop approaches and algorithms for accurate synchronization and localization in WNs that consist of low-cost communication hardware. The contributions of the thesis are as follows. First, highly precise pairwise clock synchronization for clocks with low time Resolution is considered. Synchronization is the process to align local clocks of wireless nodes, were the traditional clock model is a continuous valued function. Led by the observation that digital hardware can only count in discrete values, a novel discrete valued clock model is introduced. It is shown that the round trip time of a packet exchange between the node pair follows a parametric pulse function that depends on the frequency offset (skew), the subtick clock offset (phase), and the propagation delay between the nodes. By estimating the parameters of this function, the clock skew, the clock offset and the propagation delay can be determined with significant higher accuracy compared to when the discrete clock behaviour is neglected. Second, network wide clock synchronization is considered. Two very fast converging distributed synchronization algorithms based on Bayesian message passing techniques are developed. Deterministic propagation delays that usually cause a systematic synchronization error are considered in the algorithm designThis approach yields a higher synchronization accuracy than state of the art methods. Notably, the number of iterations required for convergence equals the maximum hop distance of an asynchronous WN node to a reference node. Third, the inherent relation between propagation delays and internode distances is leveraged and a cooperative synchronization and localization algorithm is proposed. The flexibility of message passing methods is exploited to design methods that have only moderate computational complexity. The resulting algorithm is distributed in that it does not involve a fusion center and communication is required only between neighbouring nodes. Moreover, it is suitable for real-time operation and able to cope with changes of the network topology. Fourth, a framework for passive localization with asynchronous receivers is derived, where source nodes at unknown positions are emitting arbitrary signals at unknown time. Receiving asynchronous anchor nodes act passively as they do not cooperate with the source nodes. Based on receive timestamps recorded at the anchor nodes, the source node locations are determined in a central computation unit that is connected to the anchor nodes.