Convert grams, moles and molecules.
The mole is a counting unit, defined so that one mole contains exactly 6.02214076 x 10^23 entities. That definition is what lets a laboratory balance stand in for a particle counter: dividing a measured mass by the molar mass gives the number of moles, and multiplying by Avogadro's constant converts that into an actual count of molecules. Multiplying again by the atoms in each formula unit gives total atoms, which is the figure that matters when a reaction consumes one element of a compound rather than the whole molecule. Working in the other direction, dividing molar mass by Avogadro's constant gives the mass of a single molecule — around 3 x 10^-23 g for water, which is why chemists never weigh individual particles.
Mass to moles to molecules
Moles = mass / molar mass; molecules = moles x 6.02214076e23; total atoms = molecules x atoms per formula unit; mass of one molecule = molar mass / 6.02214076e23
Because the mole was deliberately scaled that way. Carbon-12 has a relative atomic mass of 12 and one mole of it weighs 12 g, so any relative formula mass can be read straight off as grams per mole.
Yes, but the count is of formula units rather than molecules. Sodium chloride has no discrete NaCl molecules in the crystal, so one mole means 6.022 x 10^23 Na+/Cl- pairs.
Divide the count by Avogadro's constant to get moles, then multiply by the molar mass. The relationships here are all reversible.