Vanillin
Vanillin, methyl vanillin, or 4-hydroxy-3-methoxybenzaldehyde, is an organic compound with the molecular formula C8H8O3.  Its functional groups include aldehyde, ether, and phenol.  It is the primary component of the extract of the vanilla bean.  Synthetic vanillin is used as a flavoring agent in foods, beverages, and pharmaceuticals.
Methyl vanillin is used by the food industry as well as ethyl vanillin. The ethyl is more expensive but has a stronger note, and differs by having an ethoxy group (-O-CH2CH3) instead of a methoxy group (-O-CH3).
Natural vanilla extract is a mixture of several hundred different compounds in addition to vanillin.  Artificial vanilla flavoring is a solution of pure vanillin, usually of synthetic origin. Because of the scarcity and expense of natural vanilla extract, there has long been interest in the synthetic preparation of its predominant component.  The first commercial synthesis of vanillin began with the more readily available natural compound eugenol.  Today, artificial vanillin is made from either the petrochemical guaiacol, or from lignin, a natural constituent of wood which is a byproduct of the paper industry.
Lignin-based artificial vanilla flavoring is alleged to have a richer flavor profile than oil-based flavoring; the difference is due to the presence of acetovanillone in the lignin-derived product, an impurity not found in vanillin synthesized from guaiacol.

# History
Vanilla was cultivated as a flavoring by pre-Columbian Mesoamerican peoples; at the time of their conquest by Hernando Cortes, the Aztecs used it as a flavoring for chocolate.  Europeans became aware of both chocolate and vanilla around the year 1520.
Vanillin was first isolated as a relatively pure substance in 1858 by Nicolas-Theodore Gobley, who obtained it by evaporating a vanilla extract to dryness, and recrystallizing the resulting solids from hot water. In 1874, the German scientists Ferdinand Tiemann and Wilhelm Haarmann deduced its chemical structure, at the same time finding a synthesis for vanillin from coniferin, a glycoside of isoeugenol found in pine bark, and in 1876, Karl Reimer synthesized vanillin from guaiacol.  By the late 19th century, semisynthetic vanillin derived from the eugenol found in clove oil was commercially available.
Synthetic vanillin became significantly more available in the 1930s, when production from clove oil was supplanted by production from the lignin-containing waste produced by the Kraft process for preparing wood pulp for the paper industry.  By 1981, a single pulp and paper mill in Ontario supplied 60% of the world market for synthetic vanillin.  However, subsequent developments in the wood pulp industry have made its lignin wastes less attractive as a raw material for vanillin synthesis.  While some vanillin is still made from lignin wastes, most synthetic vanillin is today synthesized in a two-step process from the petrochemical precursors guaiacol and glyoxylic acid.
Beginning in 2000, Rhodia began marketing biosynthetic vanillin prepared by the action of microorganisms on ferulic acid extracted from rice bran.  At $700/kg, this product, sold under the trademarked name Rhovanil Natural, is not cost-competitive with petrochemical vanillin, which sells for around $15/kg. However, unlike vanillin synthesized from lignin or guaiacol, it can be labeled as a natural flavoring.

# Occurrence
Vanillin is most prominent as the principal flavor and aroma compound in vanilla.  Cured vanilla pods contain approximately 2% by dry weight vanillin; on cured pods of high quality, relatively pure vanillin may be visible as a white dust or "frost" on the exterior of the pod.
At smaller concentrations, vanillin contributes to the flavor and aroma profiles of foodstuffs as diverse as olive oil, butter, and raspberry and lychee fruits.  Aging in oak barrels imparts vanillin to some wines and spirits.  In other foods, heat treatment evolves vanillin from other chemicals.  In this way, vanillin contributes to the flavor and aroma of coffee, maple syrup, and whole grain products including corn tortillas and oatmeal.

# Production

## Natural production
Natural vanillin is extracted from the seed pods of Vanilla planifola, a vining orchid native to Mexico, but now grown in tropical areas around the globe.  Madagascar is presently the largest producer of natural vanillin.
As harvested, the green seed pods contain vanillin in the form of its -D-glycoside; the green pods do not have the flavor or odor of vanilla.  After being harvested, their flavor is developed by a months-long curing process, the details of which vary among vanilla-producing regions, but in broad terms it proceeds as follows:
First, the seed pods are blanched in hot water, to arrest the processes of the living plant tissues.  Then, for 12 weeks, the pods are alternately sunned and sweated: during the day, they are laid out in the sun, and each night, wrapped in cloth and packed in airtight boxes to sweat.  During this process, the pods become a dark brown, and enzymes in the pod release vanillin as the free molecule.  Finally, the pods are dried and further aged for several months, during which time their flavors further develop.  Several methods have been described for curing vanilla in days rather than months, although they have not been widely developed in the natural vanilla industry, with its focus on producing a premium product by established methods, rather than on innovations that might alter the product's flavor profile.
Vanillin accounts for about 2% of the dry weight of cured vanilla beans, and is the chief among about 200 other flavor compounds found in vanilla.

## Chemical synthesis
The demand for vanilla flavoring has long exceeded the supply of vanilla beans. As of 2001, the annual demand for vanillin was 12,000 tons, but only 1800 tons of natural vanillin were produced. The remainder was produced by chemical synthesis. Vanillin was first synthesized from eugenol (found in oil of clove) in 187475, less than 20 years after it was first identified and isolated. Vanillin was commercially produced from eugenol until the 1920s. Later it was synthesized from lignin-containing sulfite liquor, a byproduct of wood pulp processing in paper manufacture. Counter-intuitively, even though it uses waste materials, the lignin process is no longer popular because of environmental concerns, and today most vanillin is produced from the petrochemical raw material guaiacol. Several routes exist for synthesizing vanillin from guaiacol.  At present, the most significant of these is the two-step process practiced by Rhodia since the 1970s, in which guaiacol reacts with glyoxylic acid by electrophilic aromatic substitution.  The resulting vanilmandelic acid is then converted to vanillin by oxidative decarboxylation.

# Uses
The largest single use of vanillin is as a flavoring, usually in sweet foods.  The ice cream and chocolate industries together comprise 75% of the market for vanillin as a flavoring, with smaller amounts being used in confections and baked goods.
Vanillin is also used in the fragrance industry, in perfumes, and to mask unpleasant odors or tastes in medicines, livestock fodder, and cleaning products.
Vanillin has been used as a chemical intermediate in the production of pharmaceuticals and other fine chemicals.  In 1970, more than half the world's vanillin production was used in the synthesis of other chemicals, but as of 2004 this use accounts for only 13% of the market for vanillin.