Magnesium reacts with hydrochloric acid according to the equation: Mg(s) + 2 HCl(aq) --> MgCl 2(aq) + H 2(g) This demonstration can be used to illustrate the characteristic reaction of metals with acid, a single replacement reaction, or to demonstrate the generation of hydrogen gas.