We prove nonlinear modulational instability for both periodic and localized perturbations of periodic traveling waves for several dispersive PDEs, including the KDV type equations (e.g. the Whitham equation, the generalized KDV equation, the Benjamin-Ono equation), the nonlinear Schrodinger equation and the BBM equation. First, the semigroup estimates required for the nonlinear proof are obtained by using the Hamiltonian structures of the linearized PDEs; Second, for KDV type equations the loss of derivative in the nonlinear term is overcome in two complementary cases: (1) for smooth nonlinear terms and general dispersive operators, we construct higher order approximation solutions and then use energy type estimates; (2) for nonlinear terms of low regularity, with some additional assumption on the dispersive operator, we use a bootstrap argument to overcome the loss of derivative.