We study the dynamics of magnetic flows on Heisenberg groups, investigating the extent to which properties of the underlying Riemannian geometry are reflected in the magnetic flow. Much of the analysis, including a calculation of the Mañé critical value, is carried out for $$(2n+1)$$ -dimensional Heisenberg groups endowed with any left invariant metric and any exact, left-invariant magnetic field. In the three-dimensional Heisenberg case, we obtain a complete analysis of left-invariant, exact magnetic flows. This is interesting in and of itself, because of the difficulty of determining geodesic information on manifolds in general. We use this analysis to establish two primary results. We first show that the vectors tangent to periodic magnetic geodesics are dense for sufficiently large energy levels and that the lower bound for these energy levels coincides with the Mañé critical value. We then show that the marked magnetic length spectrum of left-invariant magnetic systems on compact quotients of the Heisenberg group determines the Riemannian metric. Both results confirm that this class of magnetic flows carries significant information about the underlying geometry. Finally, we provide an example to show that extending this analysis of magnetic flows to the Heisenberg-type setting is considerably more difficult.