In this paper, we aim to present a reliable algorithm in order to obtain exact and approximate solutions for the nonlinear dispersive KdV and mKdV equations with initial profile. The approach rest mainly on two-dimensional differential transform method which is one of the approximate methods. The method call easily be applied to many linear and nonlinear problems and is capable of reducing the size of computational work. Exact solutions can also be achieved by the known forms of the series solutions. We first present the definition and operation of the two-dimensional differential transform and investigate the soliton solutions of Kdv and mKdV equations are obtained by the present method. Therefore, in the present work, numerical examples are tested to illustrate the pertinent feature of the proposed algorithm. (C) 2008 Elsevier Ltd. All rights reserved.