The pressure induced phase transition from the NaCl to CsCl structure in NaH and KH has been investigated by means of first-principles calculations, and density functional linear-response theory. A pressure-induced soft-acoustic phonon mode is identified at 30GPa, and 7.5GPa for NaH and KH respectively. Phonon calculations suggest that the pressure induced instabilities of the transverse acoustic modes at the [ε00], and [εε0] directions are responsible for the phase transition of NaH and KH. Furthermore charge density analysis shows that there is charge transfer from the alkali ion to hydrogen (i.e., Na→H, K→H) inducing B1–B2 phase transition.