The molarity of a solution can be calculated as follows:
A solution which contains 1 mole of solute per litre of solution is called 1 molar.
A mole of a substance contains 6.02 x 1023 (Avogadro constant) molecules of that substance.
One mole is equal to the molecular weight of the substance in grams.
1 mole = molecular weight of substance
For example, 40 gram of NaOH (Molecular weight = 40) is equal to 1 mole of NaOH.