Blast a molecule apart, weigh every piece — the molecular weight, the fragments, and even the presence of chlorine or bromine all show up directly in the numbers.