Converting Between Formulas
Converting the molecular formula of a compound to the empirical formula is easy: just group all the atoms of each element, then reduce to lowest terms. How to determine the molecular formula from the empirical formula, on the other hand, is a little trickier!
Because more than one compound can have the same empirical formula, we need more information before we can do the conversion. There is a very important number that comes up over and over in chemistry: the mole. Also known as Avogadro's Number, it's used to do calculations on atoms or molecules without having to deal with ridiculously large numbers. One mole is equal to 6.022 x 1023 atoms or molecules. In other words, there are 602,200,000,000,000,000,000,000 atoms or molecules in one mole!
Where does that number come from? It was defined so that given one mole of a substance, its mass in grams is equal to its molecular weight. As of 2011, IUPAC (the International Union of Pure and Applied Chemistry) defines one mole to be exactly the number of atoms in 12 grams of carbon-12.
If we know the empirical formula of a compound, as well as the mass percentage, we can calculate the molecular formula. What that means is that we analyze the compound to find out what percentage, by mass, is made up of each element. Continuing with our example, we know that the atomic mass of carbon is 12.00, the mass of hydrogen is 1.008, and the mass of oxygen is 15.999. Adding these up, we find that one mole of CH2O weighs approximately 30.02 grams.
Now we take one mole of acetic acid and find out that it weighs approximately 60.03 grams. Dividing 60.03 by 30.02 and rounding, we get an answer of two, which tells us that we need to double the number of atoms in the empirical formula, giving us C2H4O2. Notice that due to measuring error, the numbers will generally not be exact! Because we know that carbon atoms prefer four bonds, oxygen atoms prefer two, and hydrogen atoms prefer one each, we're able to determine the molecular structure of the compound, CH3COOH.