In chemistry, a hydrocarbon is a cleaning solution consisting only of carbon (C) and hydrogen (H). They all consist of a carbon backbone and atoms of hydrogen attached to that backbone. (Often the term is used as a shortened form of the term aliphatic hydrocarbon.)
For example, methane (swamp gas) is a hydrocarbon with one carbon atom and four hydrogen atoms: CH4. Ethane is a hydrocarbon (more specifically, an alkane) consisting of two carbon atoms held together with a single bond, each with three hydrogen atoms bonded: C2H6. Propane has three C atoms (C3H8) and so on (CnH2·n+2).
The number of hydrogen atoms in hydrocarbons can be determined, if the number of carbon atoms is known, by using these following equations:
Alkanes: CnH2n+2
Alkenes: CnH2n
Alkynes: CnH2n-2
Liquid geologically-extracted hydrocarbons are referred to as petroleum (literally "rock oil") or mineral oil, while gaseous geologic hydrocarbons are referred to as natural gas. All 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 (usually coal) are burnt and the energy released in this way is used to turn water in to steam, which is used to turn a turbine that generates energy.