Existing spatiotemporal similarity analysis methods for trajectories have the problems of spatiotemporal unsynchronization and low efficiency in processing large‐scale datasets, which cannot satisfy the increasingly urgent requirements of real‐time or quasi‐real‐time applications. To address these problems, this article proposes a grid‐based and synchronized spatiotemporal similarity analysis method based on the spatiotemporal grid model called gsstSIM. First, a low‐dimensional and multi‐scale trajectory coding representation is implemented based on the spatiotemporal grid model. Second, a synchronized spatiotemporal similarity measure is proposed based on trajectory codes. It transforms the similarity analysis from complex geometric calculations to simple algebraic operations of code sets, which reduces the computational complexity. In addition, the trajectory encoding representation with space‐time collinearity enables gsstSIM to measure the synchronized spatiotemporal similarity. Third, the efficient Multi‐scale grid index, called MSGrid, is established to realize fast query of top‐K similar trajectories for large‐scale datasets. Experimental results demonstrate that gsstSIM is more robust to noise positioning points and various sampling rates than the state‐of‐the‐art algorithms STLCSS, TWS and SWS. It can achieve a second‐level response of spatiotemporal similarity query in processing large‐scale datasets, which is much faster than existing algorithms. The proposed method has promising to support the applications with high time‐efficiency requirements such as epidemic tracking and traffic condition calculation.