Aiming at the problem of low measurement accuracy of magnetic compass caused by its own error and magnetic interference of the carrier platform,a magnetic compass error calibration method has been proposed. By analyzing the error of the magnetic compass itself and the error caused by the magnetic interference of the carrier platform,the error calibration model has been established. Combined with the practical application conditions,the plane calibration method and space calibration method of the magnetic compass are given. The Ordinary Least Squares Regression(OLS)algorithm is used for model solution,which can also solve the on-site calibration problem of the magnetic compass. Using the developed magnetic compass,the calibration verification experiment of magnetic compass with magnetic interference has been carried out,and the azimuth accuracy before and after calibration has been tested. The experimental results show that when the maximum azimuth error is 12 ° with magnetic interference, this method can calibrate that maximum azimuth error to be only 0.2 °,which shows the effectiveness of this method. Finally,several common applications of the magnetic compass in marine field have been introduced.