Molecular weight is a very important concept to scientists working in all kinds of disciplines. It is not only useful, but also remarkably easy to calculate as long as you have the proper tools. The first ingredient is the molecular formula of the molecule to be "weighed." This can be, of course, anything, from an unadulterated element like O₂, to the most complex organic compounds.
From this formula, we shall get the atomic weight of each element in the formula from the Periodic Table. The atomic weight is the number shown below each element's symbol and represents the number of protons and neutrons in each atom of the element.
The sum of these atomic weights gives us the molecular weight. The simplicity of this formula is due to the concept of the mole.
A mole is defined as the number of units found in one gram of atomic masses; this number turns out to be approximately 6.022 x 10²³, a dimensionless constant called Avogadro's number. This is an approximation, as are the atomic weights on the Periodic Table itself, but these uncertainties are negligible for most purposes - including ours. Let us see why this number is so useful.
A mole of helium atoms for example, will contain 6.022 x 10²³ atoms; and, since each atom of helium is (approximately) four atomic masses, we see that a mole of helium weighs (6.022 x 10²³) (1 gram/6.022 x 10²³ atomic masses)(4 atomic masses) = 4 grams. Thus a molecular weight is shorthand for the weight per mole of a substance.
Let us go through the process for the water molecule, H₂O. From the molecular formula, we see we need two hydrogen atoms and one oxygen atom to make each molecule of water. According to the Periodic Table, the atomic weight of hydrogen is approximately 1 and that of oxygen approximately 16. The uncertainties in these numbers arise from the different naturally occurring isotopes of each element (hydrogen-2 and oxygen-15 for example), which create water molecules of different weight, but their distribution is so scarce as to be totally negligible for our purposes. So we shall take the molecular weight of water to be 1 + 1 + 16 = 18 atomic masses, or 18 grams per mole.
This calculation can be repeated for any substance. The molecular weight is thus obtained essentially by "reading" the atomic weights from the Periodic Table. A word about mass and weight: these oft-confused terms are in fact fundamentally different from each other, but in many circumstances the substitution of one for the other creates no difficulty. Molecular weights are given in grams per mole, but this is strictly speaking a measure of mass. On Earth (and therefore for most calculations) grams can be converted by the following factor: 1 kilogram weighs 9.8 Newtons, the metric unit of weight.