Fractional calculus is the generalization of the operators of differential and integration to non-integer order, and a differential equation involving the fractional calculus operators such as d1/2 / dt1/2 and d1/2 dt1/2 is called the fractional differential equation. They have many applications in science and engineering. But not only its analytical solutions exist only for a limited number of cases, but also, the numerical methods are difficult to solve. In this paper we propose a new numerical method based on the operational matrices of the orthogonal functions for solving the fractional calculus and fractional differential equations. Two classical fractional differential equation examples are included for demonstration. They show that the new approach is simper and more feasible than conventional methods. Advantages of the proposed method include (1) the computation is simple and computer oriented; (2) the scope of application is wide; and (3) the numerically unstable problem never occurs in our method.