The effect of valence electron concentration ͑VEC͒ and size of the X element in XMgB 14 ͑space group Imma X = Al, C, Si, Ge, Mg, Sc, Ti, V, Zr, Hf, Nb, Ta͒ on stability and elastic properties was studied using ab initio calculations. Generally, icosahedral bonds, present in these compounds, are electron deficient. Based on the Bader charge analysis ͓Bader, Atoms in Molecules: A Quantum Theory ͑Oxford University Press, New York, 1990͔͒ and density of states, X elements and Mg are shown here to transfer electrons to the boron network. Hence, the stability of the compounds studied increases as more electrons are transferred. As the VEC of the X element increases, fewer electrons are transferred to the boron network, and therefore the phase stability decreases. The bulk moduli of all compounds are in the range from 205 to 220 GPa. This can be understood analyzing the cohesive energy thereof. As the bulk modulus increases, the cohesive energy decreases.