The molecular formulas of compounds express the number and type of atoms that make up one molecule of the compound. For example, the molecular formula of table salt, or sodium chloride, is NaCl. This means table salt has one atom of sodium and one atom of chlorine.
Chlorine, a halogen, is eager to steal an electron from sodium, and sodium is eager to give an electron up. This creates an ionic bond between the two atoms that make up table salt.
Lead sulfide, or PbS, is an atom of lead bonded in a double bond to an atom of sulfur. PbS is also called galena or lead glance and is a lead ore. Silver is commonly found with galena, but galena's molecular formula shows that silver atoms are not part of the compound.
Glucose, a simple sugar, has a molecular formula of C6H12O6. This can be simplified into what's known as an empirical formula. This formula is CH2O.
The formula for ascorbic acid is C6H8O6. It is a weak acid, but it is also vitamin C, which is essential for good health. It is made of six carbon atoms, eight hydrogen atoms and six oxygen atoms. It is an acid because it releases free hydrogen ions when it is dissolved in water.