The hyperbolic cotangent transform method is used to calculate the air gap magnetic field of eccentric harmonic magnetic gear (EMHG), and the modified magnetic flux density expressions for each solution region can be obtained. It is favorable to calculate the electromagnetic torque of the magnetic gear quickly and accurately. Compared with the finite element method, the computational cost of the analytical model is lower. Therefore, a systematic optimization process is designed based on the accurate analytical model. Sensitivity analysis method and the non-dominated sorting genetic algorithm II are used for optimization analysis. From the obtained Pareto front, the best scheme is obtained by using the technique for order preference by similarity to an ideal solution. The output torque of the EMHG is increased by 76.4% after the optimization.