This paper presents numerical solutions for the space- and time-fractional Korteweg-de Vries equation (KdV for short) using the variational iteration method. The space- and time-fractional derivatives are described in the Caputo sense. In this method, general Lagrange multipliers are introduced to construct correction functionals for the problems. The multipliers in the functionals can be identified optimally via variational theory. The iteration method, which produces the solutions in terms of convergent series with easily computable components, requiring no linearization or small perturbation. The numerical results show that the approach is easy to implement and accurate when applied to space- and time-fractional KdV equations. The method introduces a promising tool for solving many space-time fractional partial differential equations. © 2007 Wiley Periodicals, Inc.