To achieve high-precision calculation of the electromagnetic field of layered media and to ensure that the apparent resistivity calculation and sensitivity are not affected by numerical errors, this paper implements high-precision calculation of the layered electromagnetic field based on the weighted average (WA) extrapolation method. Firstly, the 1D electromagnetic field expression of an arbitrary attitude field source is obtained by using the magnetic vector potential; then, the WA extrapolation technique is introduced to achieve the high-precision and fast solution of the Hankel transform, and the effects of the number of Gaussian points and the number of integration intervals on the accuracy are investigated. The theoretical model test shows that, compared with the open-source Dipole1D, the algorithm proposed in this paper has wider adaptability, and can achieve high-precision calculation of electric and magnetic dipole sources with higher efficiency. Compared with the epsilon algorithm studied by previous researchers, the WA extrapolation method proposed in this article can improve the convergence rate by approximately 20% under the same conditions. It can obtain high-precision numerical solutions with less integration time. The relative accuracy can reach the order 10−10, and its computational efficiency is significantly better than the existing epsilon algorithm. Finally, we used two cases of marine controlled source electromagnetic method to show the application. The sensitivity and Poynting vectors are calculated, which provides a technical tool for a deep understanding of physical mechanisms in layered media.