Explanation:
As the name suggests, molar mass is the mass of one mole substance in grams.
The molar mass (in grams) is numerically equal to the atomic or molecular or formula mass given in u or amu.
Hence, Molar mass is calculated by dividing the mass of substance (in grams) by the number of moles of that substance.

It can also be calculated by adding up the atomic weights (in gram) of all the elements that are present in the compound.
The units for molar mass is gram/mole or g/mol.
For example,
Molar mass of NaCl = atomic weight of 1 mole of Na + atomic weight of 1 mole of Cl
= 22.989769 g/mol + 35.453 g/mol
= 58.442769 g/mol
Final Answer:
The molar mass of a compound can be calculated by dividing the mass of a substance (in grams) by the number of moles of that substance.