The chemical formula for magnesium metal is Mg. The chemical formula for hydrochloric acid is HCl. When magnesium metal reacts with hydrochloric acid, the products are magnesium chloride (MgCl2) and hydrogen gas (H2). The chemical equation for this reaction is:
$$Mg(s) + 2HCl(aq) → MgCl2(aq) + H2(g)$$