This article focuses on computing Hamiltonian matrix exponential. Given a Hamiltonian matrix $$\mathcal {H}$$ , it is well-known that the matrix exponential $$e^{\mathcal {H}}$$ is a symplectic matrix and its eigenvalues form reciprocal $$(\lambda ,1/\bar{\lambda })$$ . It is important to take care of the symplectic structure for computing $$e^{\mathcal {H}}$$ . Based on the structure-preserving flow proposed by Kuo et al. (SIAM J Matrix Anal Appl 37:976–1001, 2016), we develop a numerical method for computing the symplectic matrix pair $$(\mathcal {M},\mathcal {L})$$ which represents $$e^{\mathcal {H}}$$ .