Samples with the same number of particles have masses in the ratio of their relative masses, so a mass in grams equal to the relative mass always contains the same number of particles. For carbon-12, 12 g contains about 6.02 × \mathrm{10^{23}} atoms.
A collection of this number of particles is one mole, written 1 mol. The quantity measured in moles is called amount of substance, and the number of particles per mole, 6.02 × \mathrm{10^{23}} /mol, is called the Avogadro constant.
Since 2019 the mole has been defined by fixing the Avogadro constant at exactly 6.02214076 × \mathrm{10^{23}} /mol. The value was chosen so that 12 g of carbon-12 still contains almost exactly one mole of atoms.
A mole always means a number of particles, so the particles have to be named. Iron is counted as atoms, water as molecules, and sodium chloride as formula units of \mathrm{NaCl}.
One mole of sodium chloride contains 1 mol of \mathrm{Na^+} and 1 mol of \mathrm{Cl^-}, and one mole of calcium chloride, \mathrm{CaCl_2}, contains 1 mol of \mathrm{Ca^{2+}} and 2 mol of \mathrm{Cl^-}, as the formula shows.
The same word can stand for different particles. One mole of oxygen molecules, \mathrm{O_2}, contains 2 mol of oxygen atoms, so it is clearer to say 1 mol of \mathrm{O_2} or 1 mol of \mathrm{O} than 1 mol of oxygen.
The mass of one mole of a substance is its molar mass, given in grams per mole, g/mol. Because a mass in grams equal to the relative mass contains one mole, the molar mass has the same value as the relative atomic, molecular or formula mass.
Carbon has a molar mass of 12.0 g/mol, water 18.0 g/mol, sodium chloride 58.5 g/mol and sucrose, \mathrm{C_{12}H_{22}O_{11}}, 342.0 g/mol. Each of these masses contains 6.02 × \mathrm{10^{23}} particles of its own kind.
A relative mass compares single particles and has no unit, while a molar mass is the mass of a fixed number of particles and has the unit g/mol. The numbers are the same, but the two quantities mean different things.
Dividing a mass by the molar mass gives the amount of substance, and multiplying the amount by the Avogadro constant gives the number of particles. The reverse steps are multiplying the amount by the molar mass and dividing the number of particles by the Avogadro constant.
For 9.0 g of water, the amount is 9.0 g ÷ 18.0 g/mol = 0.50 mol, and the number of molecules is 0.50 mol × 6.02 × \mathrm{10^{23}} /mol = 3.0 × \mathrm{10^{23}}.
Each water molecule has two hydrogen atoms, so the same water contains 0.50 mol × 2 = 1.0 mol of hydrogen atoms, which is 6.0 × \mathrm{10^{23}} atoms.
One mole of any substance contains the same number of particles, but its mass and its volume depend on the substance. The volume of one mole is the molar mass divided by the density.
At 20 °C, one mole of iron takes up about 7.1 cm³, aluminium about 10 cm³, water about 18 cm³, sodium chloride about 27 cm³ and sucrose about 220 cm³, so the volumes differ by a factor of about 30.
Gases are different. At the same temperature and pressure, one mole of any gas takes up almost the same volume, about 22.4 L at 0 °C and 1.013 × \mathrm{10^5} Pa.