Towed streamer positioning is a key step in offshore seismic exploration, and its positioning accuracy directly affects the imaging quality of subsequent seismic data. Accurate and clean magnetic compass observations are an important guarantee for high-precision towed streamer positioning. However, the existing compass data quality control methods have the problem of insufficient utilization of spatial distribution prior information, which heavily relies on mathematical statistical characteristics of the data while neglecting the crucial factors of streamer shape, bringing about an inadequate elimination of gross errors. In this work, a compass data quality control algorithm based on robust surface fitting is proposed to improve the accuracy of positioning. Firstly, the towed streamer positioning algorithm and the prior information of the spatial structure distribution of the compass are introduced. Secondly, the robust surface fitting to control the quality of compass data is proposed, and the specific process of the algorithm is given. Lastly, the effectiveness of the algorithm is verified by simulation and measured data. The results of simulation experiments indicate that compared with the traditional single-streamer threshold robust algorithm, the new algorithm has a significant effect on the quality control of compass data, and the positioning accuracy of the towed streamer is significantly improved. The positioning precision of along-line direction is improved by 52.1%, and that of the across-line direction by 52.4%. These demonstrate that the proposed new algorithm is effective for detecting and eliminating gross errors in compass observations in real-time operation scenarios, improving the stability of towed streamer shape calculation, which can better ensure the smooth progress of offshore towed streamer seismic exploration operations.