Aeromagnetic detection of underwater targets based on aircrafts has important research value, but the magnetic sensors mounted on the aircraft will be interfered by the platform. The target signal will be drowned in interference signals. Therefore, interference compensation algorithms are needed to eliminate the magnetic interference field of the aircraft. In this paper, the commonly used algorithms are compared, and an improved recursive least squares method is proposed. The simulation results show that the proposed method has the best effect and can be used in detection. In addition, the world magnetic model and the Taylor geomagnetic field model are united for the first time in the compensation process.