Here's a breakdown:
* Hydrogen gas (H2) consists of two hydrogen atoms bonded together. Each hydrogen atom has an atomic mass of 1 atomic mass unit (amu). Therefore, a hydrogen molecule (H2) has a molecular mass of 2 amu.
* Air is a mixture of gases, primarily nitrogen (N2) and oxygen (O2). Nitrogen has a molecular mass of 28 amu, and oxygen has a molecular mass of 32 amu.
Since a hydrogen molecule is significantly lighter than the average air molecule, it has a lower density. This means that a given volume of hydrogen gas will weigh less than the same volume of air. This difference in density is the reason why hydrogen gas rises in air.