The commonly used forms of the modified nonlinear Schrödinger equations for deep water (Dysthe, Proc. R. Soc. Lond. A, vol. 369, 1979, p. 105) and arbitrary depth (Brinch–Nielsen & Jonsson, Wave Motion, vol. 8, 1986, p. 455) do not conserve momentum and are not Hamiltonian. We show how these equations can be brought into Hamiltonian form, with the action, momentum and Hamiltonian being conserved. We derive the new fourth-order nonlinear Schrödinger equation for arbitrary depth, starting from the Zakharov equation enhanced with the new kernel of Krasitskii (J. Fluid Mech., vol. 272, 1994, p. 1).