Numerical methods are used to find exact solution for the nonlinear differential equations. In the last decades Iterative methods have been used for solving fractional differential equations. In this paper, the Homotopy perturbation method has been successively applied for finding approximate analytical solutions of the fractional nonlinear Klein–Gordon equation can be used as numerical algorithm. The behavior of solutions and the effects of different values of fractional order α are shown graphically. Some examples are given to show ability of the method for solving the fractional nonlinear equation.