Hydrocarbons are chemical compounds that contain the elements carbon and hydrogen only. They are compounds that are obtained from the fossil fuel crude oil by a process called fractional distillation.