The Molecular Chemistry Behind Great Coffee
Understanding how dissolved minerals in water influence coffee extraction and flavor, and the challenges of designing ideal brew water.
By Reese Scott8 min read

Coffee is often compared to wine or beer because of its range of varieties, flavors, and craft. Yet coffee has a unique complication: water is added at the point of consumption. While brew method and barista consistency certainly matter, a more fundamental factor operates at the molecular level—dissolved minerals and their role in extraction and flavor.
The nature of water and solubility
Water is the common name for H2O, a three-atom molecule that boils at about 100 °C at 1 bar of pressure. It is polar, with regions of positive (H) and negative (O) charge within each molecule. Consequently, H2O molecules interact strongly with neighbors, forming nano-networks by aligning positive and negative regions (shown in blue in Figure 1). Between 0 and 100 °C at 1 bar, a collection of H2O molecules exists as a liquid—what we call water.
Because of its small size and polarity, liquid water is an efficient solvent. The solvation mechanism depends on the polarity of the dissolved substance. Permanently polar molecules (e.g., calcium, sodium, chloride, bicarbonate) and transiently polar ones (e.g., ethanol, glucose) interact with water similarly to water-water interactions: they are stabilized by alignment of positive and negative regions (depicted in red in Figure 1). Weakly polar compounds (e.g., caffeine, n-butanal) or nonpolar ones (octane, CO2, toluene) are solvated through encapsulation (depicted in green).
The solvation mechanism for any chemical lies on a spectrum between direct interaction and encapsulation. In general, dissolving any molecule orders surrounding water, and ordering costs energy. Molecules that require more ordering are typically less soluble because water favors interactions that need the least energy. For example, CaCO3 (calcium carbonate) is poorly soluble because ordering water around Ca2+ and CO32- costs far more energy than keeping the compound solid.
Minerals in water
Your local water certainly contains more than pure H2O. Dissolved species—commonly called minerals—include various naturally occurring cations and anions, and occasionally organic molecules. Organic compounds (carbon-rich) can cause undesirable smell and taste but are easily removed by carbon filtration. Charged minerals, however, are not.
Physics requires that the net charge of the solution be zero: every positive charge must have a negative counterpart. Understanding how cations and anions influence molecular interactions helps explain how water composition affects extraction.
All cations and anions matter, but a few strongly influence the final cup. Magnesium and calcium, both cations, use their positive charge to pull flavor compounds into coffee during brewing by attracting negative regions on organic molecules such as citric acid. Bicarbonate, an anion, greatly affects coffee's chemical makeup. It neutralizes acids in coffee during brewing and also buffers pH by accepting or donating protons. Each of these ions is discussed further below.
Dissolved cations interact with water's negative regions (Figure 1 shows calcium, Ca2+, ordering water by attracting negatively charged regions). Solvated metals like calcium bind to other organic molecules through the same mechanism: cations bind to negatively charged atoms. Many organic molecules in coffee have such negative regions, so dissolved metals stick to them and pull them into water. Higher metal content aids dissolution of polar compounds by increasing these interactions during brewing.
But for every positive charge that helps extraction by grabbing oxygen- and nitrogen-rich compounds, a negative charge can act on solvated acids. In water, bicarbonate is the most active acid-buffering anion. In coffee, most acidic molecules interact strongly with bicarbonate, reducing their acidic character. This is a mixed blessing: some acids taste unpleasant (e.g., quinic acid), while others are pleasant and desirable (e.g., citric acid).
Ideal water should facilitate extraction of organic molecules via cations while moderating intense acidity and unpleasant flavors through reaction with bicarbonate.
Designing water with high flavor-extraction ability (cations) without detrimental anions for flavor or machine is immensely challenging. The balance is delicate and the window for success is narrow. Here we explore the physical challenges of obtaining designer water.

Water (H2O) forms charge-aligned nano-networks, depicted through blue dotted lines. Other molecules can interact with these charged regions of water. The calcium ion (Ca2+) is positively charged, and therefore mandates the negatively charged O to align towards it. Similarly, chloride (Cl–) attracts the positively charged regions of water (H), and there is a direct interaction between water and the species dissolved in it. Some molecules do not feature significantly polarized regions, like ethanol and n-butanal. In the case of ethanol, some nanonetworks may be formed (shown in red), while other encapsulating water networks form around the less-polar regions. Oil separates from water because the water network is stronger than the encapsulation network.
The chemistry of solvated ions
Singly-charged cations: Sodium (Na+) and Potassium (K+)
All metal ions can be considered as a point of positive charge in three-dimensional space. The magnitude and density of this charge is determined by parentage of the metal. Sodium and potassium ions carry a single positive charge that is relatively diffuse (they have low density). Water itself is highly polar, so naturally the metal ion and the OH2 will orient towards each other. However, given the charge density of the metal and the high dipole of water, the strongest cation-anion interaction is achieved with water itself. In other words, there are very few other compounds with partially negative charge (like water) that will stick more strongly to Na+ and K+ than water itself. Hence, these cations serve little purpose in aiding extraction of coffee-contained molecules because they bind to water so efficiently.
But sodium and potassium ions should still be considered as indicators of chemistry far more sinister. Given that charge neutrality is required by physics, the presence of these positive charges mandates the presence of counter-charges (anions such as bicarbonate and chloride). Therefore, water rich in sodium (more than 50 ppm) is usually an indicator that either your coffee will taste bad (due to associated bicarbonate stifling the perceived acidity in the cup) or the machine is in danger of corrosion (due to solvated chloride).
Doubly-charged cations: Magnesium (Mg2+) and Calcium (Ca2+)
Earth’s crust contains a variety of calcium and magnesium salts, which frequently come in contact with and dissolve in water. Mg2+ and Ca2+ have a tendency to stick to regions of negative charge, but unlike Na+ and K+, the doubly charged cations bind to both water and to other organic molecules. This is due to both their increased charge density and their increased size, which mandates an increase in ordered water to solvate the ion itself. This interaction can act in favor of extraction by pulling flavor from ground coffee (citric acid extracts rapidly in metal-rich water), but calcium can also be detrimental if you want to hide less flavorsome but highly polarized molecules (like ethyl acetate) that may be present in the roasted coffee. However, Ca2+ can also be problematic when in high concentrations as it forms an insoluble salt with carbonate, limescale. This can impair or even ruin a machine. Mg2+ is generally safe to consume, with no discernible negative impact on flavor, and no risks for machine health, because magnesium carbonate, MgCO3, is not readily formed in appreciable quantities.
Singly-charged anions: Fluoride (F–) and Chloride (Cl–)
Fluoride is the smallest anionic water-soluble species and is infrequently found in levels greater than approximately 1.5 mg/L (1.5 ppm). At levels found commonly in water (ca. 1 mg/L), fluoride contributes positively to health, and has no adverse impact on coffee brewing. Chloride (Cl–) is slightly larger than fluoride yet carries the same negative charge. Chloride is by far the most commonly solvated anion, and should not be confused with chlorine (Cl2), which is used to mediate bacterial growth in fresh water. Chloride is a valuable counter-ion as it balances the charge of the liquid with no adverse health or flavor effects.
However, chloride can cause catastrophic damage to equipment made of stainless steel, through the catalytic oxidation of Fe to Fe2+, causing pitting corrosion. This occurs to some extent in all concentrations of chloride.
Bicarbonate (HCO3–)
Water and atmospheric carbon dioxide react to form low concentrations of carbonic acid through the reaction: CO2 + H2O→H2CO3. Carbonic acid then further reacts with water to form bicarbonate and hydronium (as the water becomes progressively more acidic), through the reaction: H2CO3 + H2O→H3O+ + HCO3–. Bicarbonate can then react with both donors and acceptors of H+ (meaning acids and bases) to counter dramatic swings in pH.
In the context of coffee, bicarbonate may act to mask excessively unpleasant acids through buffering their H+ into the bicarbonate cycle, but even subtle concentration differences in HCO3– can result in massive effects on the perception of acidity in brewed coffee. As noted earlier, bicarbonate also forms an insoluble salt with calcium at high temperatures known as limescale. The more acidic molecules present in the water, the more bicarbonate is required to neutralize them. Perceived acidity is increased with diminishing HCO3– concentrations.

Dissolved Ca2+ (shown in yellow), binds to exposed molecules in coffee, binding temporarily to them and then extracting them into the water. In this case, the acidic and sour-tasting benzoic acid is extracted with the assistance of Ca2+ . Once in the water, benzoic acid interacts with basic solvated compounds like bicarbonate in a conventional acid-base reaction to form benzoate (a basic and bitter compound) and carbonic acid. Other molecules, like the structurally similar benzaldehyde are extracted in a similar manner, but are not affected by dissolved bases.
The paradox
In coffee extraction and flavor management, the goal is to obtain a balanced cup that features no offensively acidic characteristics, but also no flat and chalky notes. Thus, we are in pursuit of water which has relatively high dissolved cation concentrations, and low bicarbonate and chloride concentrations such that we can extract what we want from the coffee, and buffer away the negative acidity associated with common acids found in coffee. And do this without destroying the machine.
The issue is, however, that we cannot do better than physics allows. It is impossible to achieve water with high Ca2+/Mg2+ concentrations and low HCO3– and Cl– concentrations without the inclusion of other anions to charge balance. For every positive charge there is an associated negative charge somewhere in solution. (The sharp eye may have noted that, indeed, Figure 1 defies the laws of physics: the solution has a net positive charge!) There is a constant battle between machine corrosion (by the inclusion of Cl–) and perceived acidity (through the presence of HCO3–), and other common anions (including the strongly basic –OH, the poo-inducing SO42- and other negatively charged species). Short of formulating your own water, or filtering in a creative manner, modulating water chemistry remains a challenge. Identifying the makeup of your incoming water and selecting the correct filtration unit are paramount in enabling you and your café the best chance of making a consistently good espresso shot.







