Magnesium alanate Mg(AlH4)2 has recently raised interest as a potential material for hydrogen storage. We apply ab initio calculations to characterize structural, electronic and energetic properties of Mg(AlH4)2. Density functional theory calculations within the generalized gradient approximation (GGA) are used to optimize the geometry and obtain the electronic structure. The latter is also studied by quasi-particle calculations at the GW level. Mg(AlH4)2 is a large band gap insulator with a fundamental band gap of 6.5 eV. The hydrogen atoms are bonded in AlH4 complexes, whose states dominate both the valence and the conduction bands. On the basis of total energies, the formation enthalpy of Mg(AlH4)2 with respect to bulk magnesium, bulk aluminum and hydrogen gas is 0.17 eV/H2 (at T = 0). Including corrections due to the zero point vibrations of the hydrogen atoms this number decreases to 0.10 eV/H2. The enthalpy of the dehydrogenation reaction Mg(AlH4)2 -> MgH2 +2Al+3H2(g) is close to zero, which impairs the potential usefulness of magnesium alanate as a hydrogen storage material.