In chemistry, a hydrocarbon is an organic compound consisting only of carbon and hydrogen. They all consist of carbon backbone and atoms of hydrogen attached to that backbone.

There are basically three types of hydrocarbons: saturated hydrocarbons, which don't have double, triple or aromatic bonds, unsaturated hydrocarbons, which have one or more double or triple bonds between carbon atoms, and aromatic hydrocarbons, which have at least one aromatic ring in addition to whatever bonds they have.

Unsaturated hydrocarbons are divided into

Liquid geologically-extracted hydrocarbons are referred to as petroleum (literally "rock oil") while gaseous geologic hydrocarbons are referred to as natural gas. Both are significant sources of fuel and raw materials as a feedstock for the production of organic chemicals and are commonly found in the subsurface using the tools of petroleum geology.

Hydrocarbons are of prime economic importance because they encompass the constituents of the major fossil fuels, petroleum and natural gas, as well as plastics, waxes, and oils. In urban pollution, these components--along with NOx and sunlight--contribute to the formation of tropospheric ozone.