A Hamiltonian density is a local integrand for the field-theory Hamiltonian. For canonical fields with invertible velocity-momentum relation it is the Legendre transform in mechanics of the Lagrangian density, summing over all conjugate field components. Gauge theories require constraints and multiplier terms as well.
New to topics? Read the docs here!