Theoretical studies of structures, cohesive energies,reaction enthalpies and densities of states (DOSs) of Mg7TMH16 (TM=Sc, Ti, V, Y, Zr, Nb) compounds are performed using the first-principles method based on the density functional theory in the generalized gradient approximation. The cohesive energies are calculated to analyze the stability, and the formation abilities of Mg7TiH16 and Mg7NbH16 are stronger than others. The obtained formation enthalpy for hydride Mg7TMH16 is used to investigate the possible pathways of formation reaction. The calculated formation enthalpy changes show that the decomposition temperature of Mg7TMH16 is lower than that of MgH2. The electronic DOSs reveal that all the hydrides studied here exhibit metallic characteristics.