Crude oil is a mixture of many varieties of hydrocarbons and most usually have many sulfur-containing compounds. The oil refining process commonly includes hydrodesulfurization which converts most of that sulfur into gaseous hydrogen sulfide. Raw natural gas also may contain gaseous hydrogen sulfide and sulfur-containing mercaptans, which are removed in natural-gas processing plants before the gas is distributed to consumers.
The hydrogen sulfide removed in the refining and processing of crude oil and natural gas is subsequently converted into byproduct elemental sulfur. In fact, the vast majority of the 64,000,000 metric tons of sulfur produced worldwide in 2005 was byproduct sulfur from refineries and natural-gas processing plants.