A new nondestructive inspection method, the magnetic hammer test (MHT), which uses a compact and highly sensitive tunnel magnetoresistance (TMR) sensor, is proposed. This method complements the magnetic flux leakage method and eliminates the issues of the hammer test. It can therefore detect weak magnetic fields generated by the natural vibration of a pipe with a high signal-to-noise ratio. In this study, several steel pipes with different wall thicknesses were measured using a TMR sensor to demonstrate the superiority of MHT. The results of the measurement show that wall thickness can be evaluated with the accuracy of several tens of microns from the change in the natural vibration frequency of the specimen pipe. The pipes were also inspected underwater using a waterproofed TMR sensor, which demonstrated an accuracy of less than 100 μm. The validity of these results was by simulating the shielding of magnetic fields and vibration of the pipes with the finite element method (FEM) analysis. The proposed noncontact, fast, and accurate method for thickness testing of long-distance pipes will contribute to unmanned, manpower-saving nondestructive testing (NDT) in the future.