A molecule may consists of atoms of one element only or may be more than one. But a compound is formed when atoms of at least two different elements combine. For example N2 is a molecule but not a compound and H2O is a molecule as well as a compound. So allcompounds are molecules, but all molecules are notcompounds.