The Hermite-Gaussian (HG) modes, sometimes also referred to as transverse electromagnetic modes in free space, form a complete and orthonormal basis that have been extensively used to describe optical fields. In addition, these modes have been shown to be helpful to enhance information capacity of optical communications as well as to achieve super-resolution imaging in microscopy. Here we propose and present the realization of an efficient, robust mode sorter that can sort a large number of HG modes based on the relation between HG modes and Laguerre-Gaussian (LG) modes. We experimentally demonstrate the sorting of 16 HG modes, and our method can be readily extended to a higher-dimensional state space in a straightforward manner. We expect that our demonstration will have direct applications in a variety of fields including fiber optics, classical and quantum communications, as well as super-resolution imaging.