Abstract Flake, pit and through-hole defects are the three common types of defects in oil pipelines. In practical testing applications, it is necessary to clarify the magnetic leakage characteristics of different defects and set reasonable detection points to distinguish different types of defects accurately and quantify the degree of each defect precisely. In this paper, the leakage magnetic field of flaky, pitted and through-hole tube wall defect is analyzed. Using three-dimensional finite element simulation, the spatial stereo model of leakage magnetic field is inverted by extracting the data of characteristic nodes. The distribution of the leakage magnetic field in space, for the radial and circumferential components is obtained. On this basis, the effect on the main components of magnetic leakage field at different locations in space is determined, and the best of placing a potential sensor for detecting three kinds of defects in space are derived. This provides a basis for determining sensor locations in magnetic leakage detection devices, inverting defect models from multi-sensor data and accurately quantifying the degree of defects.