The most common physical formalisms are the Lagrangian formalism and the Hamiltonian formalism. From the superficial point of view, they are one and the same, but rewritten in other terms. However, it seems that the Hamiltonian formalism has a richer structure and is more convenient for studying the electromagnetic field, especially in the formalization of its geometrization. Unfortunately for field problems, there is a whole set of Hamiltonian formalisms. The authors study the applicability of different variants of the Hamiltonian formalism to the problems of electrodynamics. In this paper we consider the Hamiltonian formalism with constraints. © COPYRIGHT SPIE. Downloading of the abstract is permitted for personal use only.