The main focus of this paper is to present a numerical method for the solution of fractional differential equations. In this method, the properties of the Caputo derivative are used to reduce the given fractional differential equation into a Volterra integral equation. The entire domain is divided into several small domains, and by collocating the integral equation at two adjacent points a system of two algebraic equations in two unknowns is obtained. The method is applied to solve linear and nonlinear fractional differential equations. Also the error analysis is presented. Some examples are given and the numerical simulations are also provided to illustrate the effectiveness of the new method