Natural gas is a mixture of hydrocarbons primarily consisting of methane, with smaller amounts of other alkanes and compounds containing sulfur, nitrogen, or carbon dioxide. It is extracted from beneath the earth's surface and used as fuel for heating, electricity generation, and as a raw material in the chemical industry.