Vehicular ad hoc networks (VANETs) represent a very promising research area because of their ever increasing demand, especially for public safety applications. In VANETs vehicles communicate with each other to exchange road maps and traffic information. In many applications, location-based services are the main service, and localization accuracy is the main problem. VANETs also require accurate vehicle location information in real time. To fulfill this requirement, a number of algorithms have been proposed; however, the location accuracy required for public safety applications in VANETs has not been achieved. In this paper, an improved subspace algorithm is proposed for time of arrival (TOA) measurements in VANETs localization. The proposed method gives a closed-form solution and it is robust for large measurement noise, as it is based on the eigen form of a scalar product and dimensionality. Furthermore, we developed the Cramer-Rao Lower Bound (CRLB) to evaluate the performance of the proposed 3D VANETs localization method. The performance of the proposed method was evaluated by comparison with the CRLB and other localization algorithms available in the literature through numerous simulations. Simulation results show that the proposed 3D VANETs localization method is better than the literature methods especially for fewer anchors at road side units and large noise variance.