You first begin by finding all of the molar masses of each element in a compound.
The compound we will use in this example is CO2. C (carbon) has a molar mass of 12.01. O (oxygen) has a molar mass of 16.0. Because there are 2 Oxygen atoms per Carbon atom, the molar mass of Oxygen in this compound is 32.
We then add the masses together to find the total mass of the molecule. 12.01 of carbon and 32.0 of oxygen equals 44.01 moles.
There is 72.71% Oxygen in the compound CO2.
Lets start with oxygen. There is 32 moles of Oxygen in the 44.01 moles of CO2. 32 divided by 44.01 is .7271, then you multiply by 100 to get 72.71%
The next step is to find out how much of each element is in the molecule.
To find the percentage of carbon in CO2, you follow the same steps as you did with oxygen
12.01 moles of carbon divided by 44.01 moles of CO2 is equal to .2728, which is then multiplied by 100 to get 27.28% of carbon in the compound CO2.
A simple tip to check if you got the right answer is to see if the percentages you got add up to 100%.
72.71% of carbon plus 27.28% of oxygen equals 99.99%, which is really close to 100%, so we got the calculations correct!
So remember... (number of atoms of element)(molar/atomic mass) divided by (total molar mass of compound) gives you the percent composition!