Covalent chemical bonds involve the sharing of a pair of valence electrons by two atoms, in contrast to the transfer of electrons in ionic bonds. Such bonds lead to stable molecules if they share electrons in such a way as to create a noble gas configuration for each atom. Hydrogen gas forms the simplest covalent bond in the diatomic hydrogen molecule. The halogens such as chlorine also exist as diatomic gases by forming covalent bonds.