In organic chemistry, a hydrocarbon is an organic compound consisting entirely of hydrogen and carbon.  Hydrocarbons are examples of group 14 hydrides. Hydrocarbons from which one hydrogen atom has been removed are functional groups called hydrocarbyls. Because carbon has 4 electrons in its outermost shell (and because each covalent bond requires a donation of 1 electron, per atom, to the bond) carbon has exactly four bonds to make, and is only stable if all 4 of these bonds are used.
Aromatic hydrocarbons (arenes), alkanes, cycloalkanes and alkyne-based compounds are different types of hydrocarbons.
Types of hydrocarbons
As defined by IUPAC nomenclature of organic chemistry, the classifications for hydrocarbons are:
Saturated hydrocarbons are the simplest of the hydrocarbon species. They are composed entirely of single bonds and are saturated with hydrogen. The formula for acyclic saturated hydrocarbons (i.e., alkanes) is CnH2n+2.  The most general form of saturated hydrocarbons is CnH2n+2(1-r), where r is the number of rings. Those with exactly one ring are the cycloalkanes. Saturated hydrocarbons are the basis of petroleum fuels and are found as either linear or branched species. Substitution reaction is their characteristics property (like chlorination reaction to form chloroform). Hydrocarbons with the same molecular formula but different structural formulae are called structural isomers.  As given in the example of 3-methylhexane and its higher homologues, branched hydrocarbons can be chiral.  Chiral saturated hydrocarbons constitute the side chains of biomolecules such as chlorophyll and tocopherol.
Unsaturated hydrocarbons have one or more double or triple bonds between carbon atoms. Those with double bond are called alkenes. Those with one double bond have the formula CnH2n (assuming non-cyclic structures).  Those containing triple bonds are called alkyne. Those with one triple bond have the formula CnH2n−2. 
Aromatic hydrocarbons, also known as arenes, are hydrocarbons that have at least one aromatic ring.
Because of differences in molecular structure, the empirical formula remains different between hydrocarbons; in linear or "straight-run" alkanes, alkenes and alkynes, the amount of bonded hydrogen lessens in alkenes and alkynes due to the "self-bonding" or catenation of carbon preventing entire saturation of the hydrocarbon by the formation of double or triple bonds.
This inherent ability of hydrocarbons to bond to themselves is known as catenation, and allows hydrocarbons to form more complex molecules, such as cyclohexane, and in rarer cases, arenes such as benzene. This ability comes from the fact that the bond character between carbon atoms is entirely non-polar, in that the distribution of electrons between the two elements is somewhat even due to the same electronegativity values of the elements (~0.30), and does not result in the formation of an electrophile.
Generally, with catenation comes the loss of the total amount of bonded hydrocarbons and an increase in the amount of energy required for bond cleavage due to strain exerted upon the molecule; in molecules such as cyclohexane, this is referred to as ring strain, and occurs due to the "destabilized" spatial electron configuration of the atom.
In simple chemistry, as per valence bond theory, the carbon atom must follow the 4-hydrogen rule, which states that the maximum number of atoms available to bond with carbon is equal to the number of electrons that are attracted into the outer shell of carbon. In terms of shells, carbon consists of an incomplete outer shell, which comprises 4 electrons, and thus has 4 electrons available for covalent or dative bonding.
Hydrocarbons are hydrophobic like lipids.
Simple hydrocarbons and their variations
|Alkane (single bond)||Alkene (double bond)||Alkyne (triple bond)||Cycloalkane||Alkadiene|
|2||Ethane||Ethene (ethylene)||Ethyne (acetylene)||—||—|
|3||Propane||Propene (propylene)||Propyne (methylacetylene)||Cyclopropane||Propadiene (allene)|
Hydrocarbons are a primary energy source for current civilizations. The predominant use of hydrocarbons is as a combustible fuel source. In their solid form, hydrocarbons take the form of asphalt (bitumen).
Mixtures of volatile hydrocarbons are now used in preference to the chlorofluorocarbons as a propellant for aerosol sprays, due to chlorofluorocarbons' impact on the ozone layer.
Methane (CH4) and ethane (C2H6) are gaseous at ambient temperatures and cannot be readily liquefied by pressure alone. Propane (C3H8) is however easily liquefied, and exists in 'propane bottles' mostly as a liquid. Butane (C4H10) is so easily liquefied that it provides a safe, volatile fuel for small pocket lighters. Pentane (C5H12) is a colorless liquid at room temperature, commonly used in chemistry and industry as a powerful nearly odorless solvent of waxes and high molecular weight organic compounds, including greases. Hexane (C6H14) is also a widely used non-polar, non-aromatic solvent, as well as a significant fraction of common gasoline. The C6 through C10 alkanes, alkenes and isomeric cycloalkanes are the top components of gasoline, naphtha, jet fuel and specialized industrial solvent mixtures. With the progressive addition of carbon units, the simple non-ring structured hydrocarbons have higher viscosities, lubricating indices, boiling points, solidification temperatures, and deeper color. At the opposite extreme from methane lie the heavy tars that remain as the lowest fraction in a crude oil refining retort. They are collected and widely utilized as roofing compounds, pavement composition, wood preservatives (the creosote series) and as extremely high viscosity shear-resisting liquids.
Hydrocarbon use is also prevalent in nature. Some eusocial arthropods, such as the Brazilian stingless bee, Schwarziana quadripunctata, use unique hydrocarbon "scents" in order to determine kin from non-kin. The chemical hydrocarbon composition varies between age, sex, nest location, and hierarchal position.
Hydrocarbon poisoning such as that of benzene and petroleum usually occurs accidentally by inhalation or ingestion of these cytotoxic chemical compounds. Intravenous or subcutaneous injection of petroleum compounds with intent of suicide or abuse is an extraordinary event that can result in local damage or systemic toxicity such as tissue necrosis, abscess formation, respiratory system failure and partial damage to the kidneys, the brain and the nervous system. Moaddab and Eskandarlou report a case of chest wall necrosis and empyema resulting from attempting suicide by injection of petroleum into the pleural cavity.
There are three main types of reactions:
Substitution reactions only occur in saturated hydrocarbons (single carbon–carbon bonds). In this reaction, an alkane reacts with a chlorine molecule. One of the chlorine atoms displaces a hydrogen atom. This forms hydrochloric acid as well as the hydrocarbon with one chlorine atom.
all the way to CCl4 (carbon tetrachloride)
all the way to C2Cl6 (hexachloroethane)
Addition reactions involve alkenes and alkynes. In this reaction a halogen molecule breaks the double or triple bond in the hydrocarbon and forms a bond.
Hydrocarbons are currently the main source of the world's electric energy and heat sources (such as home heating) because of the energy produced when burnt. Often this energy is used directly as heat such as in home heaters, which use either petroleum or natural gas. The hydrocarbon is burnt and the heat is used to heat water, which is then circulated. A similar principle is used to create electrical energy in power plants.
- 2 O
In inadequate supply of air, carbon monoxide gas and water vapour are formed:
- 2 CH4
- 3 O
- 5 O
And finally, for any linear alkane of n carbon atoms,
Burning of hydrocarbons is an example of an exothermic chemical reaction.
Extracted hydrocarbons in a liquid form are referred to as petroleum (literally "rock oil" – petrol for short) or mineral oil, whereas hydrocarbons in a gaseous form are referred to as natural gas. Petroleum and natural gas are found in the Earth's subsurface with the tools of petroleum geology and are a significant source of fuel and raw materials for the production of organic chemicals.
The extraction of liquid hydrocarbon fuel from sedimentary basins is integral to modern energy development. Hydrocarbons are mined from oil sands and oil shale, and potentially extracted from sedimentary methane hydrates. These reserves require distillation and upgrading to produce synthetic crude and petroleum.
Oil reserves in sedimentary rocks are the source of hydrocarbons for the energy, transport and petrochemical industries.
Bacteria in the gabbroic layer of the ocean's crust can degrade hydrocarbons; but the extreme environment makes research difficult. Other bacteria such as Lutibacterium anuloederans can also degrade hydrocarbons. Mycoremediation or breaking down of hydrocarbon by mycelium and mushrooms is possible.
Many hydrocarbons are highly flammable; therefore, care should be taken to prevent injury. Benzene and many aromatic compounds are possible carcinogens, and proper safety equipment must be worn to prevent these harmful compounds from entering the body. If hydrocarbons undergo combustion in tight areas, toxic carbon monoxide can form. Hydrocarbons should be kept away from fluorine compounds due to the high probability of forming toxic hydrofluoric acid.
Burning hydrocarbons as fuel, producing carbon dioxide and water, is a major contributor to anthropogenic global warming. Hydrocarbons are introduced into the environment through their extensive use as fuels and chemicals as well as through leaks or accidental spills during exploration, production, refining, or transport. Anthropogenic hydrocarbon contamination of soil is a serious global issue due to contaminant persistence and the negative impact on human health.
Abiogenic petroleum origin
Biomass to liquid
Organic nuclear reactor