Magnetic flux leakage (MFL), a pipeline internal detection, is the mainstream technology for international oil and gas pipeline safety maintenance. To address the problem of large errors in the assessment of defects in pipeline inspection by existing theoretical analysis models, this paper introduces the charge density parameter to establish a mathematical model of non-uniform magnetic charge for pipeline leakage detection and calculates the non-uniform distribution pattern of magnetic charge on the defect side wall. The contour plot method is proposed to visually analyze the size of defects. To compare the error between uniform and non-uniform models, and verify the correctness of the theoretical model, experiments were systematically conducted on the X70 pipeline with internal MFL technology. The results show that: the magnetic charge distribution curve is symmetrically shaped at the center of the defect, with a valley at the center and two peaks at the defect edge. As the defect depth and width increase, the magnetic charge density increases sharply near the surface and edge. The peak-to-valley spacing and peak-to-valley values in the contour map of the magnetic flux leakage signal can directly reflect the location and size of defects. The signal characteristic values follow the trend of a first-order decreasing exponential function as the value of the lift-off increases. The first-order derivative of the signal characteristic value tends to decrease and then increase as the mesh size decreases, and the extreme point of the derivative curve is the best mesh size.