The Hamiltonian–Krein (instability) index is concerned with determining the number of eigenvalues with positive real part for the Hamiltonian eigenvalue problem inline image, where inline image is skew-symmetric and inline image is self-adjoint. If inline image has a bounded inverse the index is well established, and it is given by the number of negative eigenvalues of the operator inline image constrained to act on some finite-codimensional subspace. There is an important class of problems—namely, those of KdV-type—for which inline image does not have a bounded inverse. In this paper, we overcome this difficulty and derive the index for eigenvalue problems of KdV-type. We use the index to discuss the spectral stability of homoclinic traveling waves for KdV-like problems and Benjamin—Bona—Mahony-type problems.