Crude oil is primarily composed of hydrocarbons (mixtures of hydrogen and carbon molecules) plus impurities like sulfur, nitrogen, oxygen compounds, and metals. The hydrocarbons range from light gases to heavy tars, which refineries separate into different products.