Hello, Katrina,
Let's assume we have 100 grams of vanillin.
By assuming 100g, we can write the percentages as grams of that element. We then need to adjust the grams measurement to account for the fact that elements have different atomic masses. Hydrogen is so small that 5 grams is actually a lot of atoms. Both carbon and oxygen are larger, By dividing by their masses by their atomic weights, we can normalize these differences. The third column is the result of the element masses divided by that element's atomic mass. These normalized values can be directly compared to each other. The column tells us the the empirical formula for vanillin is C0.42H0.423O0.157.
We can leave it like this, because we need whole numbers of atoms. Each should be a whole number. Let's try increasing the O atom by a factor that brings it to 1 O atom. That number is (1/0.157), or 6.36. When we multiply 6.36 times 0.157 we get 1 H atom. We need to use the same factor for both C and H, but when we do we get values of 2.67 for C and 2.69 for H. We need whole numbers, so try setting the oxygen to 2, instead of one. That conversion factor is 12.71. But both carbon and hydrogen are, again, not close to whole numbers (5.34 and 5.38).
But if we try increasing the oxygen to 3 (a factor of 19.07) and use that same factor for carbon and hydrogen, we get values of 8.00 for carbon and 8.06 for hydrogen. Those are close to whole numbers, thus the empirical formula is C8H8O3.
Bob
↓------multiply by 19.07 to get-----↓
63.15 g C | ÷ 12 | = 0.420 | = 8 |
5.30 g H | ÷ 1 | = 0.423 | = 8 |
31.55 g O | ÷ 16 | = 0.157 | = 3 |