We introduce a new technique to level aerogeophysical data. Our approach is applicable to flight-line data without any need for tie-line measurements. The technique is based on polynomial fitting of data points in 1D and 2D sliding windows. A polynomial is fitted to data points in a 2D circular window that contains at least three flight lines. Then the same procedure is done inside a 1D window placed at the center of the 2D window. The leveling error is the difference between 1D and 2D polynomial fitted data at the center of the windows. To demonstrate the reliability of the method, it was tested on a synthetic aeromagnetic data set contaminated by some linear artifacts. Using the differential polynomial fitting method, we can remove the linear artifacts from the data. The method then was applied to two real airborne data sets collected in Iran. The leveling errors are removed effectively from the aeromagnetic data using the differential polynomial fitting. In the case of helicopter-towed electromagnetic (HEM) data, the polynomial fitting method is used to level the measured real (in-phase) and imaginary (quadrature) components, as well as the calculated apparent resistivity. The HEM data are sensitive to height variations, so we introduce an average-height scaling method to reduce the height effect before leveling in-phase and quadrature components. The method also is effective in recovering some of the attenuated anomalies. After scaling, the differential polynomial fitting method was applied to the data and effectively removed the remaining line-to-line artifacts.