A single atom has a very small mass. One carbon-12 atom, the isotope of carbon with 6 protons and 6 neutrons, has a mass of about 1.99 × \mathrm{10^{-23}} g, and a hydrogen-1 atom has a mass of about 1.67 × \mathrm{10^{-24}} g.
Numbers this small are hard to work with, so the masses of atoms are compared instead. The carbon-12 atom is given a relative mass of exactly 12, and every other atom is measured against one twelfth of its mass, which is about 1.66 × \mathrm{10^{-24}} g.
On this scale, hydrogen-1 is 1.0078 and oxygen-16 is 15.995. Each value is close to the mass number, because a proton and a neutron have almost the same mass and electrons add very little. A relative mass is a ratio, so it has no unit.
Most elements are mixtures of isotopes, and the proportions are almost the same wherever the element is found. The relative atomic mass of an element is the average of the relative masses of its isotopes, weighted by how common each one is.
Natural copper is 69.15 % copper-63, with a relative mass of 62.93, and 30.85 % copper-65, with a relative mass of 64.93. Its relative atomic mass is 62.93 × 0.6915 + 64.93 × 0.3085 = 63.55, closer to 63 because copper-63 is the more common isotope.
Relative atomic masses are given in the periodic table. In calculations they are usually rounded, for example hydrogen 1.0, carbon 12.0, nitrogen 14.0, oxygen 16.0, sodium 23.0 and chlorine 35.5.
The relative molecular mass of a substance is the sum of the relative atomic masses of all the atoms in its molecule. It compares the mass of one molecule with one twelfth of the mass of a carbon-12 atom, so it has no unit either.
Water, \mathrm{H_2O}, has two hydrogen atoms and one oxygen atom, so its relative molecular mass is 1.0 × 2 + 16.0 = 18.0.
In the same way, carbon dioxide, \mathrm{CO_2}, is 12.0 + 16.0 × 2 = 44.0, and glucose, \mathrm{C_6H_{12}O_6}, is 12.0 × 6 + 1.0 × 12 + 16.0 × 6 = 180.0.
On the same scale, one carbon dioxide molecule is about 2.4 times as heavy as one water molecule, because 44.0 ÷ 18.0 is about 2.4.
Sodium chloride is a crystal of sodium ions and chloride ions, and every ion is surrounded by ions of the opposite charge in the same way. No group of ions can be picked out as a molecule, so a relative molecular mass cannot be given.
Instead, the formula \mathrm{NaCl}, which gives the ratio of the ions, is used. Its relative formula mass is the sum of the relative atomic masses in it: 23.0 + 35.5 = 58.5. For calcium chloride, \mathrm{CaCl_2}, it is 40.1 + 35.5 × 2 = 111.1.
The same is done for covalent network crystals such as silicon dioxide, \mathrm{SiO_2}, whose relative formula mass is 28.1 + 16.0 × 2 = 60.1.
An electron has about 1/1840 of the mass of a proton, so gaining or losing electrons hardly changes the mass of an atom. An ion is given the same relative mass as its atom, and \mathrm{Na^+} is also 23.0.
Relative masses compare particles one to one. A glucose molecule, 180.0, is ten times as heavy as a water molecule, 18.0, so if single molecules could be weighed, ten water molecules would balance one glucose molecule.
The same holds for larger numbers. Samples with the same number of molecules have masses in the ratio of their relative molecular masses, so glucose is ten times as heavy as water with the same number of molecules.
It follows that 18.0 g of water and 180.0 g of glucose contain the same number of molecules. Counting particles by weighing them in this way leads to the amount of substance and its unit, the mole.