Abstract-In this paper, a 3D quasi-static numerical algorithm for computation of the magnetic field produced by power lines is presented. These power lines can be overhead power line phase conductors and shield wires or buried cable line phase conductors. The basis of the presented algorithm is the application of Biot-Savart law and the thin-wire approximation of cylindrical conductors. The catenary form of the power line conductors is approximated by a set of straight cylindrical segments. By summing up contributions of all conductor segments, magnetic field distribution is computed. On the basis of the presented theory, a FORTRAN program PFEMF for computation of the magnetic flux density distribution was developed. For each conductor catenary, it is necessary to define only global coordinates of the beginning and ending points and also the value of the longitudinal phase conductor current. Global coordinates of beginning and ending points of each catenary segment are generated automatically in PFEMF. Numerical results obtained by program PFEMF are compared with results obtained by simple 2D model and results obtained using software package CDEGS.