Thermodynamic Calculations and Diagrams for Geochemistry

Thermodynamic database with minerals and inorganic and organic aqueous species.
Balance reactions with basis species, calculate standard Gibbs energy, equilibrium constant, and chemical affinity.
Make Eh–pH, logfO2–pH, and other types of chemical activity diagrams.
What is it?

The CHNOSZ package for R provides an integrated set of tools for thermodynamic calculations in aqueous geochemistry and geobiochemistry. It has functions for writing balanced reactions to form species from user-selected basis species and for calculating the standard molal properties of species and reactions, including the standard Gibbs energy and equilibrium constant (details). Calculations of the non-equilibrium chemical affinity and equilibrium chemical activity of species can be portrayed on diagrams as a function of temperature, pressure, or activity of basis species; in two dimensions, this gives a maximum affinity or predominance diagram. The diagrams have formatted chemical formulas and axis labels, and water stability limits can be added to Eh-pH, logfO2-T, and other diagrams with a redox variable. The package has been developed to handle common calculations in aqueous geochemistry, such as solubility due to complexation of metal ions, mineral buffers of redox or pH, and changing the basis species across a diagram ("mosaic diagrams"). CHNOSZ also implements a group additivity algorithm for the standard thermodynamic properties of proteins.

An Example
Based on a figure from Yang et al. (2018)
basis(c("Fe", "H2", "H2S", "H2O"),
  c("cr", "aq", "aq", "liq"))
species(c("hematite", "pyrite",
  "pyrrhotite", "magnetite"))
a <- affinity(H2S = c(-4, -1.5),
  H2 = c(-6, -1), T = 300, P = 700)
diagram(a, fill = "terrain")
title(main = "Fe-O-H-S")
  c("300 °C, 700 bar"))
More diagrams All examples
  1. Get R from the Comprehensive R Archive Network (CRAN).
  2. Start an R session, then use these commands to install and load the package and run the examples from the help files:
  3. install.packages("CHNOSZ")
  4. To install the development version, use this command instead:
  5. install.packages("CHNOSZ",
      repos = "")
  • GeoTPD: Shiny interface by Evgeniy Bastrakov
  • pyCHNOSZ: Python wrapper by Grayson Boyer


Calculate Equilibrium Constants for GWB Thermodynamic Data Files

GitHub last commit

Install logKcalc from GitHub. Here are the vignettes from the package:


Chemical Metrics of Differentially Expressed Proteins


Install canprot from GitHub or CRAN. Here you can browse the HTML help pages and vignettes from the package:


Plots from Papers by Jeffrey M. Dick

GitHub last commit DOI

Install JMDplots from GitHub. See below for selected vignettes or all vignettes from the package.

Geochemical Biology
Chemical characteristics of human microbiomes (2023) preprint
Geochemical influence on protein evolution (2023) preprint
Chemical links between redox conditions and community reference proteomes (2023)
Water as a reactant in the differential expression of proteins in cancer (2021)
Geochemical information from genomes (2023)
Water activity and redox potential in evolution and development (2022)
Energy release during protein synthesis at ultramafic-hosted hydrothermal systems (2021)

CHNOSZ, logKcalc, canprot, and JMDplots are free software made available under the GPL. The maintainer of these packages is Jeffrey Dick. Please contact him at

Last updated: 2023-05-30