To calculate the number of moles in a solution is to calculate how many molecules the solution contains. In order to do this, you need to know the volume of the solution and how much solute has been dissolved in it, as well as the molar mass of the solute.

### Understanding Moles

A mole is a huge number used to measure atoms. It is equal to the number of atoms in 12 grams of carbon-12, which is approximately 6.022 x 10^{23} atoms. Just as it's easier to measure intergalactic distances in light years rather than inches, it's easier to count atoms in moles than in billions or trillions.

One mole of any element or chemical compound is always the same number. One mole of hydrogen is the same as one mole of uranium or one mole of glucose. Their mass, however, is different.

### Calculating Molar Mass

Every element has a different molar mass, expressed as grams per mole. For example, one mole of sodium (Na) has a mass of 22.9898 g/mol. The molar mass of chlorine (Cl) is 35.4530 g/mol.

Since most molecules are made of more than one element, you often have to figure out the molar mass of a molecule by breaking it down into its elements. You can find the molar mass of each element on the periodic table of elements.

For example, if you want to calculate the molar mass of NaCl, or table salt, you add the mass of each element. Each molecule has one Na and one Cl atom. Therefore the mass of one mole of NaCl is the mass of Na plus the mass of Cl:

NaCl = Na + Cl

NaCl = 22.9898 g/L + 35.4530 g/L

NaCl = 58.4538 g/L

Note that the number of atoms in a molecule varies. Each molecule of H_{2}0, for example, has two hydrogen atoms and one oxygen atom.

### Calculating Molarity

Molarity is the number of moles per liter of solution, expressed as M. To calculate molarity, use the equation:

molarity = moles of solute / liters of solution

Before you can use this equation, you first need to know how many moles of solute are in the solution. To do this, multiply the mass of solute you have by its molar mass conversion factor. For example, if you have mixed 25g of table salt, or NaCl, into 2 liters of water, you first need to determine how many moles are in 25g of NaCl.

One mole of NaCl has a mass of approximately 58.5 grams. This gives it a conversion factor of 1/58.5.

Multiplying 25g by 1/58.5, which is the same as dividing 25 by 58.5, tells us that there are 0.427 moles of NaCl in the solution. Now you can use the equation and plug in the numbers:

molarity = moles of solute / liters of solution

molarity = 0.427/2

molarity = 0.2135

Because the molarity conversion factor used here is only accurate to three decimal places, round off the molarity. Therefore:

molarity = 0.214 M NaCl