Heterocyclic compounds are substances which contain a ring structure as found in benzene and the aromatic compounds, or aromatic hydrocarbons, but in which other atoms than carbon, such as sulfur, oxygen or nitrogen are found as part of the ring. Some examples are pyridine (C5H5N) and pyrimidine (C4H4N2).

Note that compounds such as cyclopropane, an anaesthetic with explosive properties, and cyclohexane, a solvent are not heterocyclic, they are merely cycloalkanes. The suffix '-cyclic' implies a ring structure, while 'hetero' refers to an atom other than carbon, as above.