Abstract. We derive a variational characterization of the exact discrete Hamiltonian, which is a Type II generating function for the exact flow of a Hamiltonian system, by considering a Legendre transformation of Jacobi’s solution of the Hamilton–Jacobi equation. This provides an exact correspondence between continuous and discrete Hamiltonian mechanics, which arise from the continuous and discrete-time Hamilton’s variational principle on phase space, respectively. The variational characterization of the exact discrete Hamiltonian naturally leads to a class of generalized Galerkin Hamiltonian variational integrators, which include the symplectic partitioned Runge–Kutta methods. This extends the framework of variational integrators to Hamiltonian systems with degenerate Hamiltonians, for which the standard theory of Lagrangian variational integrators cannot be applied. We also characterize the group invariance properties of discrete Hamiltonians which lead to a discrete Noether’s theorem. 1.