A coffee bean is a seed of the coffee plant and the source for coffee. It is the pit inside the red or purple fruit often referred to as a cherry. Just like ordinary cherries, the coffee fruit is also a so-called stone fruit. Even though the coffee beans are seeds, they are referred to as "beans" because of their resemblance to true beans. The fruits – coffee cherries or coffee berries – most commonly contain two stones with their flat sides together. A small percentage of cherries contain a single seed, instead of the usual two. This is called a "peaberry". The peaberry occurs only between 10 and 15% of the time, and it is a fairly common (yet scientifically unproven) belief that they have more flavour than normal coffee beans.[1] Like Brazil nuts (a seed) and white rice, coffee beans consist mostly of endosperm.[2]

The two most economically important varieties of coffee plant are the Arabica and the Robusta; ~60% of the coffee produced worldwide is Arabica and ~40% is Robusta.[3] Arabica beans consist of 0.8–1.4% caffeine and Robusta beans consist of 1.7–4% caffeine.[4] As coffee is one of the world's most widely consumed beverages, coffee beans are a major cash crop and an important export product, counting for over 50% of some developing nations' foreign exchange earnings.[5]

The bean belt in yellow: The 20 largest producers (2011) are in green.

South America is now responsible for about 45% of the world's total coffee exports. Most of this coffee is grown in Brazil.[6]

The United States imports more coffee than any other nation.[6] The per capita consumption of coffee in the United States in 2011 was 4.24 kg (9 lbs), and the value of coffee imported exceeded $8 billion.[7] As of 2015, Americans consumed approximately 400 million cups of coffee per day, making the United States the leading consumer of coffee in the world.[8]

The coffee tree averages from 5–10 m (16–33 ft) in height. As the tree gets older, it branches less and less and bears more leaves and fruits.

Coffee plants are grown in rows several feet apart. Some farmers plant fruit trees around them or plant the coffee on the sides of hills, because they need specific conditions to flourish. Ideally, Arabica coffee beans are grown at temperatures between 15 and 24 °C (59 and 75 °F) and Robusta at 24–30 °C (75–86 °F) and receive between 15 and 30 cm (5.9 and 11.8 in) of rainfall per year.[14] Heavy rain is needed in the beginning of the season when the fruit is developing and less later in the season as it ripens.

When the fruit is ripe, it is almost always handpicked, using either "selective picking", where only the ripe fruit is removed, or "strip-picking", where all of the fruit is removed from a limb all at once. This selective picking gives the growers reason to give their coffee a certain specification called "operation cherry red" (OCR). In rare circumstances, the Asian palm civet eats coffee berries and excretes the beans. These beans are called kopi luwak, and can be processed further into a rare and expensive coffee.

Two methods are primarily used to process coffee berries. The first, "wet" or "washed" process, has historically usually been carried out in Central America and areas of Africa. The flesh of the cherries is separated from the seeds and then the seeds are fermented – soaked in water for about two days. This softens the mucilage which is a sticky pulp residue that is still attached to the seeds. Then this mucilage is washed off with water.

The "dry processing" method, cheaper and simpler, was historically used for lower-quality beans in Brazil and much of Africa, but now brings a premium when done well. Twigs and other foreign objects are separated from the berries and the fruit is then spread out in the sun on concrete, bricks or raise beds for 2–3 weeks, turned regularly for even drying.

The term "green coffee bean" refers to unroasted mature or immature coffee beans. These have been processed by wet or dry methods for removing the outer pulp and mucilage and have an intact wax layer on the outer surface. When immature, they are green. When mature, they have a brown to yellow or reddish color and typically weigh 300 to 330 mg per dried coffee bean. Nonvolatile and volatile compounds in green coffee beans, such as caffeine, deter many insects and animals from eating them. Further, both nonvolatile and volatile compounds contribute to the flavor of the coffee bean when it is roasted. Nonvolatile nitrogenous compounds (including alkaloids, trigonelline, proteins, and free amino acids) and carbohydrates are of major importance in producing the full aroma of roasted coffee and for its biological action. Since the mid 2000s, green coffee extract has been sold as a nutritional supplement and has been clinically studied for its chlorogenic acid content and for its lipolytic and weight-loss properties.

Caffeine (1,3,7-trimethyl-xanthine) is the alkaloid most present in green and roasted coffee beans. The content of caffeine is between 1.0% and 2.5% by weight of dry green coffee beans. The content of caffeine does not change during maturation of green coffee beans.[15] Lower concentrations of theophylline, theobromine, paraxanthine, liberine, and methylliberine can be found. The concentration of theophylline, an alkaloid noted for its presence in green tea, is reduced during the roasting process, usually about 15 minutes at 230 °C (446 °F), whereas the concentrations of most other alkaloids are not changed.[16] The solubility of caffeine in water increases with temperature and with the addition of chlorogenic acids, citric acid, or tartaric acid, all of which are present in green coffee beans. For example, 1 g (0.035 oz) of caffeine dissolves in 46 ml (1.6 US fl oz) of water at room temperature, and 5.5 ml (0.19 US fl oz) at 80 °C (176 °F).[17] The xanthine alkaloids are odorless, but have a bitter taste in water, which is masked by organic acids present in green coffee, however.

Trigonelline (N-methyl-nicotinate) is a derivative of vitamin B6 that is not as bitter as caffeine. In green coffee beans, the content is between 0.6% and 1.0%. At a roasting temperature of 230 °C (446 °F), 85% of the trigonelline is degraded to nicotinic acid, leaving small amounts of the unchanged molecule in the roasted beans. In green coffee beans, trigonelline is synthesized from nicotinic acid (pyridinium-3-carboxylic acid) by methylation from methionine, a sulfur-containing amino acid.[18]Mutagenic activity of trigonelline has been reported.[19]

Proteins account for 8% to 12% of dried green coffee beans. A majority of the proteins are of the 11-S storage kind[20] (alpha – component of 32 kDa, beta – component of 22 kDa), most of which are degraded to free amino acids during maturation of green coffee beans. Further, 11-S storage proteins are degraded to their individual amino acids under roasting temperature, thus are an additional source of bitter components due to generation of Maillard reaction products.[21] High temperature and oxygen concentration and low pH degrade 11-S storage proteins of green coffee beans to low-molecular-weight peptides and amino acids. The degradation is accelerated in the presence of organic acids such as chlorogenic acids and their derivatives. Other proteins include enzymes, such as catalase and polyphenol oxidase, which are important for the maturation of green coffee beans. Mature coffee contains free amino acids (4.0 mg amino acid/g robusta coffee and up to 4.5 mg amino acid/g arabica coffee). In Coffea arabica, alanine is the amino acid with the highest concentration, i.e. 1.2 mg/g, followed by asparagine of 0.66 mg/g, whereas in C. robusta, alanine is present at a concentration of 0.8 mg/g and asparagine at 0.36 mg/g.[22][23] The free hydrophobic amino acids in fresh green coffee beans contribute to the unpleasant taste, making it impossible to prepare a desirable beverage with such compounds. In fresh green coffee from Peru, these concentrations have been determined as: isoleucine 81 mg/kg, leucine 100 mg/kg, valine 93 mg/kg, tyrosine 81 mg/kg, phenylalanine 133 mg/kg. The concentration of gamma-aminobutyric acid (a neurotransmitter) has been determined between 143 mg/kg and 703 mg/kg in green coffee beans from Tanzania.[24] Roasted coffee beans do not contain any free amino acids; the amino acids in green coffee beans are degraded under roasting temperature to Maillard products (reaction products between the aldehyde group of sugar and the alpha-amino group of the amino acids). Further, diketopiperazines, e.g. cyclo(proline-proline), cyclo(proline-leucine), and cyclo(proline-isoleucine), are generated from the corresponding amino acids, and are the major source of the bitter taste of roasted coffee.[25] The bitter flavor of diketopiperazines is perceptible at around 20 mg/liter of water. The content of diketopiperazines in espresso is about 20 to 30 mg, which is responsible for its bitterness.[26][27]

Carbohydrates make up about 50% of the dry weight of green coffee beans. The carbohydrate fraction of green coffee is dominated by polysaccharides, such as arabinogalactan, galactomannan, and cellulose, contributing to the tasteless flavor of green coffee. Arabinogalactan makes up to 17% of dry weight of green coffee beans, with a molecular weight of 90 kDa to 200 kDa. It is composed of beta-1-3-linked galactan main chains, with frequent members of arabinose (pentose) and galactose (hexose) residues at the side chains comprising immunomodulating properties by stimulating the cellular defense system (Th-1 response) of the body. Mature brown to yellow coffee beans contain fewer residues of galactose and arabinose at the side chain of the polysaccharides, making the green coffee bean more resistant to physical breakdown and less soluble in water.[28] The molecular weight of the arabinogalactan in coffee is higher than in most other plants, improving the cellular defense system of the digestive tract compared to arabinogalactan with lower molecular weight.[29] Free monosaccharides are present in mature brown to yellow-green coffee beans. The free part of monosaccharides contains sucrose (gluco-fructose) up to 9000 mg/100g of arabica green coffee bean, a lower amount in robustas, i.e. 4500 mg/100g. In arabica green coffee beans, the content of free glucose was 30 to 38 mg/100g, free fructose 23 to 30 mg/100g; free galactose 35 mg/100g and mannitol 50 mg/100g dried coffee beans, respectively. Mannitol is a powerful scavenger for hydroxyl radicals, which are generated during the peroxidation of lipids in biological membranes.[30]

The lipids found in green coffee include: linoleic acid, palmitic acid, oleic acid, stearic acid, arachidic acid, diterpenes, triglycerides, unsaturated long-chain fatty acids, esters, and amides. The total content of lipids in dried green coffee is between 11.7 and 14 g/100 g.[31] Lipids are present on the surface and in the interior matrix of green coffee beans. On the surface, they include derivatives of carboxylic acid-5-hydroxytryptamides with an amide bond to fatty acids (unsaturated C6 to C24) making up to 3% of total lipid content or 1200 to 1400 microgram/g dried green coffee bean. Such compounds form a wax-like cover on the surface of the coffee bean (200 to 300 mg lipids/100 g dried green coffee bean) protecting the interior matrix against oxidation and insects. Further, such molecules have antioxidative activity due to their chemical structure.[32] Lipids of the interior tissue are triglycerides, linoleic acid (46% of total free lipids), palmitic acid (30% to 35% of total free lipids), and esters. Arabica beans have a higher content of lipids (13.5 to 17.4 g lipids/100 g dried green coffee beans) than robustas (9.8 to 10.7 g lipids/100 g dried green coffee beans). The content of diterpenes is about 20% of the lipid fraction. The diterpenes found in green coffee include cafestol, kahweol and 16-O-methylcafestol. Some of these diterpenes have been shown in in vitro experiments to protect liver tissue against chemical oxidation.[33] In coffee oil from green coffee beans the diterpenes are esterified with saturated long chain fatty acids.

Chlorogenic acids belong to a group of compounds known as phenolic acids, which are antioxidants. The content of chlorogenic acids in dried green coffee beans of robusta is 65 mg/g and of arabica 140 mg/g, depending on the timing of harvesting. At roasting temperature, more than 70% of chlorogenic acids are destroyed, leaving a residue less than 30 mg/g in the roasted coffee bean. In contrast to green coffee, green tea contains an average of 85 mg/g polyphenols. These chlorogenic acids could be a valuable, inexpensive source of antioxidants. Chlorogenic acids are homologous compounds comprising caffeic acid, ferulic acid and 3,4-dimethoxycinnamic acid, which are connected by an ester bond to the hydroxyl groups of quinic acid.[34] The antioxidant capacity of chlorogenic acid is more potent than of ascorbic acid (vitamin C) or mannitol, which is a selective hydroxy-radical scavenger.[35] Chlorogenic acids have a bitter taste in low concentrations such as 50 mg/l water. At higher concentrations of 1 g/l water, they have a sour taste. Chlorogenic acids increase the solubility of caffeine and are important modulators of taste.

Volatile compounds of green coffee beans include short-chain fatty acids, aldehydes, and nitrogen-containing aromatic molecules, such as derivatives of pyrazines (green-herbeaceous-earthy odor). Briefly, such volatile compounds are responsible for the less pleasing odor and taste of green coffee versus roasted coffee. Commercial success was realized by Starbucks in creating Green Bean Refreshers using a process that primarily isolates the caffeine from the green beans but does not actually use steeped liquid from the beans.[36] Many consumers experiment with creating green bean "extract" by steeping green coffee beans in hot water. Often, the recommended times of steeping (20 minutes to 1 hour) extract too much caffeine to provide a pleasant taste. A steeping time of 12 minutes or under provides a more palatable liquid that can be used as a base for a drink containing more of the nutrients and less caffeine that using just isolated caffeine extract.[37] The alkaline stock base that results can be paired with acidic or fruity extracts, with or without sweetener, to mask the vegetable-like taste of the extract.