Balanced chemical equations have the same number of each atom (and the same mass) on both sides of the reaction.
Chemical formulas are balanced; that is, the same number of each type of atom will be on both sides of the reaction.
On your periodic table, notice the atomic masses. These are in grams/mol(or specific number of atoms).
Therefore, if you've conserved the exact number of atoms in the formula, you've also shown conservation of mass.