Abstract In this paper, He's variational iteration method (VIM) is applied to solve the Emden–Fowler type equations in the second-order ordinary differential equations (ODEs). In this method, general Lagrange multipliers are introduced to construct correction functionals for the problems. The Lagrange multipliers in the functionals can be identified optimally via variational theory. This technique provides a sequence of functions which convergence to the exact solutions of the Emden–Fowler equations. Comparison with the exact solutions and the solutions by the Adomian decomposition method (ADM) show efficiency of VIM in solving equations with singularity.