Natural gas processing plants are used to purify the raw natural gas extracted from underground gas fields and brought up to the surface by gas wells. The processed natural gas, used as fuel by residential, commercial and industrial consumers, is almost pure methane (CH4) and is very much different from the raw natural gas.
Raw natural gas typically consists primarily of methane, the shortest and lightest hydrocarbon molecule. It also contains varying amounts of:
- Heavier gaseous hydrocarbons: ethane (C2H6), propane (C3H8), normal butane](n-C4H10), isobutane (i-C4H10), pentanes and even higher molecular weight hydrocarbons. When processed and purified into finished by-products, all of these are collectively referred to as Natural Gas Liquids (NGL)).
- Acid gases: carbon dioxide (CO2), hydrogen sulfide (H2S) and mercaptans such as methanethiol (CH3SH) and ethanethiol (C2H5SH).
- Other gases: nitrogen (N2) and helium (He).
- Water: water vapor and liquid water.
- Liquid hydrocarbons: perhaps some natural gas condensate (also referred to as casinghead gasoline or natural gasoline) and/or crude oil.
- Mercury: very small amounts of mercury primarily in elemental form, but chlorides and other species are possibly present.
Raw natural gas must be purified to meet the quality standards specified by the major pipeline transmission and distribution companies. Those quality standards vary from pipeline to pipeline and are usually a function of a pipeline system’s design and the markets that it serves. In general, the standards specify that the natural gas:
- Be within a specific range of heating value (caloric value). For example, in the United States, it should be about 1,035 ± 5% Btu per standard cubic foot of gas at an absolute pressure of 1 atmosphere and 60 °F (41 ± 5% MJ per normal cubic meter of gas at 1 atmosphere of absolute pressure and 0 °C).
- Be delivered at or above a specified hydrocarbon dew point temperature (below which some of the hydrocarbons in the gas might condense at pipeline pressure forming liquid slugs which could damage the pipeline).
- Be free of particulate solids and liquid water to prevent erosion, corrosion or other damage to the pipeline.
- Be dehydrated of water vapor sufficiently to prevent the formation of methane hydrates within the gas processing plant or subsequently within the sales gas transmission pipeline. 
- Contain no more than trace amounts of components such as hydrogen sulfide, carbon dioxide, mercaptans, nitrogen, and water vapor.
- Maintain mercury at less than detectable limits (approximately 0.001 ppb by volume) primarily to avoid damaging equipment in the gas processing plant or the pipeline transmission system from mercury amalgamation and embrittlement of aluminum and other metals.  
Raw natural gas comes primarily from any one of three types of wells: crude oil wells, gas wells, and condensate wells. Natural gas that comes from crude oil wells is typically termed associated gas. This gas can exist separate from the crude oil in the underground formation, or dissolved in the crude oil.
Natural gas from gas wells and from condensate wells, in which there is little or no crude oil, is termed non-associated gas. Gas wells typically produce only raw natural gas, while condensate wells produce raw natural gas along with a low-boiling point mixture of liquid hydrocarbons called natural gas condensate (sometimes also called natural gasoline, casinghead gasoline or simply condensate').
Raw natural gas can also come from methane deposits in the pores of coal seams. Such gas is referred to as ''coalbed gas'' and it is also called 'sweet gas'' because it is relatively free of hydrogen sulfide.
There are a great many ways in which to configure the various unit processes used in the processing of raw natural gas. The schematic block flow diagram below is a generalized, typical configuration for the processing of raw natural gas from non-associated gas wells. It shows how raw natural gas is processed into sales gas transported by pipeline to the end user markets.   It also shows how processing of the raw natural gas yields these byproducts:
- Natural gas condensate
- Natural gas liquids (NGL): propane, butanes and C5+ (which is the commonly used term for pentanes plus higher molecular weight hydrocarbons)
Raw natural gas is commonly collected from a group of adjacent wells and is first processed at that collection point for removal of free liquid water and natural gas condensate. The condensate is usually then transported to a petroleum refinery and the water is disposed of as wastewater.
The raw gas is then pipelined to a gas processing plant where the initial purification is usually the removal of acid gases (hydrogen sulfide and carbon dioxide). There a many processes that are available for that purpose as shown in the flow diagram, but Amine gas treating is the most widely used process. In the last ten years, a new process based on the use of polymeric membranes to dehydrate and separate the carbon dioxide and hydrogen sulfide from the natural gas stream is gaining acceptance.
The acid gases removed by amine treating are then routed into a sulfur recovery unit which converts the hydrogen sulfide in the acid gas into elemental sulfur. There are a number of processes available for that conversion, but the Claus process is by far the one usually selected. The residual gas from the Claus process is commonly called ''tail gas'' and that gas is then processed in a tail gas treating unit (TGTU) to recover and recycle residual sulfur-containing compounds back into the Claus unit. Again, as shown in the flow diagram, there are a number of processes available for treating the Claus unit tail gas. The final residual gas from the TGTU is incinerated. Thus, the carbon dioxide in the raw natural gas ends up in the incinerator flue gas stack.
The next step in the gas processing plant is to remove water vapor from the gas using either the regenerable absorption in liquid triethylene glycol (TEG), commonly referred to as glycol dehydration, or a pressure swing adsorption (PSA) unit which is regenerable adsorption using a solid adsorbent.
Mercury is then removed by using adsorption processes (as shown in the flow diagram below) such as activated carbon or regenerable molecular sieves.
Nitrogen is next removed and rejected using one of the three processes indicated on the flow diagram:
- Cryogenic process using low temperature distillation. This process can be modified to also recover helium, if desired.
- Absorption process using lean oil or a special solvent as the absorbent.
- Adsorption process using activated carbon or molecular sieves as the adsorbent. This process may have limited applicability because it is said to incur the loss of butanes and heaver hydrocarbons.
The next step is to recover the natural gas liquids (NGL) for which most large, modern gas processing plants use another cryogenic low temperature distillation process involving expansion of the gas through a turbo-expander followed by distillation in a demethanizing fractionating column.  Some gas processing plants use a lean oil absorption process rather than the cryogenic turbo-expander process.
The residue gas from the NGL recovery section is the final, purified sales gas which is pipelined to the end-user markets.
The recovered NGL stream is processed through a fractionation train consisting of three distillation towers in series: a deethanizer, a depropanizer and a debutanizer. The overhead product from the deethanizer is ethane and the bottoms are fed to the depropanizer. The overhead product from the depropanizer is propane and the bottoms are fed to the debutanizer. The overhead product from the debutanizer is a mixture of normal and iso-butane, and the bottoms product is a C5+ mixture. The recovered streams of propane, butanes and C5+ are each "sweetened" in a Merox process unit to convert undesirable mercaptans into disulfides and, along with the recovered ethane, are the final NGL by-products from the gas processing plant.
- ^ Advanced Mercury Removal Technologies (From UOP website page)
- ^ Dehydration of Natural Gas by Prof. Jon Steiner Gudmundsson, Norwegian University of Science and Technology
- ^ Glycol Dehydration (Includes a flow diagram}
- ^ Same as Reference 1
- ^ The Roles of Granular Activated Carbon in Gas Conditioning Marta J. Bourke and Anthony F. Mazzoni, presented at the Laurance Reid Gas Conditioning Conference, Norman, Oklahoma, March 1989.
- ^ Using Gas Geochemistry to Assess Mercury Risk, (From the website of GasChem.com)
- ^ Natural Gas Processing: The Crucial Link Between Natural Gas Production and Its Transportation to Market
- ^ Overview of UOP Gas Processing Technologies and Applications Scroll down to pdf page 11 of 25 pdf pages.
- ^ From Purification to Liquefaction Gas Processing
- ^ Same as Reference 3
- ^ UOP MolSiv Dehydration (includes a flow diagram of a PSA unit)
- ^ Same as Reference 1
- ^ "Gas Processes 2002", Hydrocarbon Processing, pages 84-86, May 2002 (schematic flow diagrams and descriptions of nitrogen rejection and nitrogen removal processes)
- ^ Market-Driven Evolution of Gas Processing Technologies for NGLs by Yuv R. Mehra (From the website of Advanced Extraction Technology Inc.)
- ^ AET Process Nitrogen Rejection Unit (From the website of Advanced Extraction Technology Inc.)
- ^ Cryogenic Turbo-Expander Process (From the website Advanced Extraction Technology Inc.)
- ^ "Gas Processes 2002", Hydrocarbon Processing, pages 83-84, May 2002 (schematic flow diagrams and descriptions of the NGL-Pro and NGL Recovery processes)
- ^ Same as Reference 14
- Milton Beychok