The magnetic field of end windings affects the leakage reactance of end windings and the eddy current losses of end structures in the large electrical machine. With the rising of single-machine capacity, such effect becomes more obvious. However, due to the complexity of end structures of large electrical machine, it will cause difficulty in meshing and long calculation time to calculate the magnetic field of end windings by using 3-D finite element method (FEM). In order to calculate the magnetic field of end windings quickly and accurately, an improved analytical algorithm (IAA) is proposed based on the mirror image principle, which takes into account the influence of stator back core and air-gap on the magnetic field of end windings by adding the fictitious boundary current and air-gap current, respectively. Taking a 300Mvar synchronous condenser (SC) as an example, the boundary current, air-gap current and magnetic field of end windings are calculated. Then, the influence of stator back core and stator involute segment current on the magnetic field of end windings are analyzed, which provides a theoretical support for the design and optimization of SC. To validate the accuracy of IAA, the calculation result is compared with 3-D FEM.INDEX TERMS Synchronous condenser, magnetic field, analytical algorithm, mirror image, stator back core.