HODMD: Higher Order Dynamic Mode Decomposition. This paper deals with an extension of dynamic mode decomposition (DMD), which is appropriate to treat general periodic and quasi-periodic dynamics, and transients decaying to periodic and quasi-periodic attractors, including cases (not accessible to standard DMD) that show limited spatial complexity but a very large number of involved frequencies. The extension, labeled as higher order dynamic mode decomposition, uses time-lagged snapshots and can be seen as superimposed DMD in a sliding window. The new method is illustrated and clarified using some toy model dynamics, the Stuart--Landau equation, and the Lorenz system. In addition, the new method is applied to (and its robustness is tested in) some permanent and transient dynamics resulting from the complex Ginzburg--Landau equation (a paradigm of pattern forming systems), for which standard DMD is seen to only uncover trivial dynamics, and the thermal convection in a rotating spherical shell subject to a radial gravity field.