We consider the canonical formulation of Whitham’s variational principle for the KdV equation. This Lagrangian is degenerate and we have found it necessary to use Dirac’s theory of constrained systems in constructing the Hamiltonian. Earlier discussions of the Hamiltonian structure of the KdV equation were based on various different decompositions of the field which is avoided by this new approach.