Sugar is both a molecule and a compound because it consists of multiple atoms of different elements (carbon, hydrogen, and oxygen) chemically bonded together.
The sugar molecules, modeled by atoms of different colors representing different types of atoms, indicate that sugar is not an element, but it is both a molecule and a compound. An element contains only one type of atom. In contrast, a molecule is a group of two or more atoms chemically bonded together, and a compound is a substance composed of two or more different elements joined by chemical bonds.
As sugar is made up of carbon, hydrogen, and oxygen atoms, it fulfills the criteria for being both a molecule and a compound. For example, sucrose, a common table sugar, has a molecular formula of C₁₂H₂₂O₁₁, clearly showing it contains multiple different atoms chemically bonded.