The molar mass is given by:
M = Mr · g · mol-1
Below are examples that show you how to calculate the molar mass in practice.
The molar mass of H2O is:
M(H2O) = (2 * 1.008 + 15.999) = 18.015 g /mol
The molar mass of C2H5OH is:
M(C2H5OH) = (2*12.011 + 6*1.008 + 15.999) = 46.069 g/mol