In this paper, we construct a Malliavin derivative for functionals of square-integrable Levy processes and derive a Clark-Ocone formula. The Malliavin derivative is defined via chaos expansions involving stochastic integrals with respect to Brownian motion and Poisson random measure. As an illustration, we compute the explicit martingale representation for the maximum of a Levy process.