Abstract The Radio Frequency Interference (RFI) makes the most performance degradation for the Synthetic Aperture Imaging (SAI) and the object detection of Stepped-Frequency Ground Penetrating Radar (SFGPR). This paper proposes a random phase-coded method to transform RFI into zero-mean random signal without effect on the object’s echo. Then the RFI can be suppressed easily by a classical average filter. Analysis indicates that the proposed method makes the SFGPR have the same anti-RFI performance as that of noise radar. It keeps the low sidelobe property of SFGPR and can be realized by FFT. Monte Carlo simulation conforms to the theoretic analysis and demonstrates that the proposed method is effective.