Hydrocarbons are a subgroup of organic compounds, which contain only carbon and hydrogen. Examples of hydrocarbons can be seen in Figure 1. Salicylic acid, also shown in Figure 1, is an organic compound, but it’s not a hydrocarbon as it contains oxygen groups.

There are 3 hydrocarbons on the left. These are methane, propane, and 1-butene.They all contain C H bonds and no other functional groups. On the right is a molecule which is not a hydrocarbon. This is salicylic acid. This molecule contains C-H bonds, but also contains carbonate and hydroxyl groups, meaning it is not a hydrocarbon.

Figure 1. On the left: the structures of molecules which are hydrocarbons, such as methane, propane, and 1-butene. On the right: the structure of salicylic acid which is not a hydrocarbon.