The Nernst equation, E = E° − (RT/nF) ln Q, gives the voltage of an electrochemical cell or electrode when concentrations and temperature are not at standard values. E° is the standard potential, R the molar gas constant, T the absolute temperature, n the number of electrons transferred, F the Faraday constant and Q the reaction quotient. At 25 °C the factor RT/F is 25.69 mV, which is why a pH electrode moves by about 59.16 mV for each pH unit and why a neuron's potassium gradient sets a voltage near −90 mV.
This post goes one level deeper than our tour of the laws of thermodynamics and sits beside the Arrhenius equation explained, which uses the same gas constant R to describe how fast reactions go. Arrhenius is about rates. Nernst is about equilibrium: how much electrical push a chemical difference can produce, and at what voltage the push and the chemistry balance.
A note on numbers. The equation, the standard potentials and the cell chemistry come from OpenStax Chemistry 2e, the constants from NIST's CODATA tables, the history from the Nobel Foundation and from Crossref records of the original papers, and the nerve cell concentrations from a Harvard and MIT neuroscience course problem set. Values we chose ourselves, such as buffer readings and lithium insertion fractions, are labelled as illustrative. Every number was recomputed with the Python script in the walkthrough. None of it is medical advice.
Key takeaways
- The equation: E = E° − (RT/nF) ln Q. Use T in kelvin, n as the electrons in the balanced reaction, and Q built from activities (approximated by molar concentrations in dilute solutions and partial pressures in bar for gases).
- The 25 °C shortcut: with base 10 logarithms, E = E° − (0.05916 V/n) log Q. The number 0.05916 V is (RT/F) × ln 10 at 298.15 K, and it changes with temperature: 54.20 mV at 0 °C, 61.54 mV at 37 °C.
- The constants are exact: since the 2019 SI revision, F = e × N_A = 96 485.332 12... C/mol and R = k × N_A = 8.314 462 618... J mol⁻¹ K⁻¹, both listed by NIST as exact.
- History: Walther Nernst published the theory of galvanic cells in 1889 in Zeitschrift für Physikalische Chemie, volume 4, pages 129 to 181. His Nobel Prize in Chemistry 1920, received in 1921, was "in recognition of his work in thermochemistry", not for the equation itself.
- Batteries: a Daniell cell has E° = 1.0988 V with the OpenStax table; drop the copper ion concentration a hundredfold and the voltage falls by 59 mV.
- pH meters: a glass electrode is a Nernstian hydrogen ion sensor. Two buffers fix the slope and offset; temperature compensation corrects the slope, not the chemistry of the sample.
- Nerve cells: with 137 mM potassium inside and 5 mM outside, the potassium equilibrium potential at 37 °C is about −88 mV. The Goldman equation blends several ions by permeability and lands near the measured resting potential of roughly −70 mV.
- Lithium-ion cells: open circuit voltage rises with state of charge, but the curve is not a single Nernst term. Battery management systems measure it and store it as a lookup table.
What does the Nernst equation say?
OpenStax Chemistry 2e introduces the Nernst equation in section 17.4 as the tool to "determine cell potentials under nonstandard conditions." The general form is:
E = E° − (RT / nF) · ln Q
At 25 °C, after converting the natural logarithm to base 10 and putting in the constants, it becomes the form most chemistry students learn:
E = E° − (0.05916 V / n) · log Q (T = 298.15 K only)
OpenStax rounds 0.05916 V to 0.0592 V. The two forms are the same equation. Only the first is valid at every temperature.
Read it from left to right. E is the voltage you would measure across the cell with no current flowing. E° is the voltage under standard conditions, where every dissolved species is at unit activity and every gas at 1 bar. The second term is the correction: how far the actual mixture is from standard, expressed through Q, scaled by the thermal voltage RT/F and divided by the number of electrons n that the balanced reaction moves.
The sign tells you the direction. As the reaction runs forward, products build up and reactants are used, so Q grows, ln Q grows and E falls. When Q reaches the equilibrium constant K, E reaches zero. A battery at that point is flat: it has no free energy left to deliver.
Each term, its meaning and its unit
| Symbol | Name | Meaning | Unit | Value or typical range |
|---|---|---|---|---|
| E | Cell or electrode potential | Voltage at zero current under actual conditions | V | Millivolts to a few volts |
| E° | Standard potential | Voltage with all species at unit activity, gases at 1 bar | V | From about −3.04 V (Li⁺/Li) to +2.866 V (F₂/F⁻) in the OpenStax table |
| R | Molar gas constant | Converts temperature to energy per mole | J mol⁻¹ K⁻¹ | 8.314 462 618... exact |
| T | Absolute temperature | Thermodynamic temperature | K | 298.15 K at 25 °C, 310.15 K at 37 °C |
| n | Electrons transferred | Moles of electrons per mole of reaction as written | none | 1 for Ag⁺/Ag, 2 for Cu²⁺/Cu |
| F | Faraday constant | Charge on one mole of electrons | C mol⁻¹ | 96 485.332 12... exact |
| Q | Reaction quotient | Products over reactants, each raised to its coefficient | none | Any positive number |
The units work out because RT/F is joules per mole divided by coulombs per mole, which is joules per coulomb, which is volts. Q has no units because it is built from activities, which are dimensionless ratios. In practice you put concentrations in mol/L and pressures in bar, and the reference values of 1 mol/L and 1 bar divide out silently.
The thermal voltage RT/F
The quantity RT/F appears so often that it has a name in physiology and electronics: the thermal voltage. At 25 °C it is 25.693 mV. At body temperature, 37 °C, it is 26.727 mV. Multiply by ln 10 (2.302 585) to get the slope per decade of concentration:
| Temperature | T (K) | RT/F (mV) | Slope per tenfold change, n = 1 (mV) |
|---|---|---|---|
| 0 °C | 273.15 | 23.538 | 54.20 |
| 10 °C | 283.15 | 24.400 | 56.18 |
| 20 °C | 293.15 | 25.262 | 58.17 |
| 25 °C | 298.15 | 25.693 | 59.16 |
| 37 °C | 310.15 | 26.727 | 61.54 |
| 50 °C | 323.15 | 27.847 | 64.12 |
| 80 °C | 353.15 | 30.432 | 70.07 |
That last column is the most useful single fact in this post. For a one electron process, every tenfold change in the activity ratio shifts the voltage by that many millivolts. For a two electron process, divide by two.
Where the equation comes from
The Nernst equation is a rewrite of a thermodynamic identity. The Gibbs free energy change for a reaction in any mixture is ΔG = ΔG° + RT ln Q. Electrical work and free energy are linked by ΔG = −nFE, and in the standard state ΔG° = −nFE°. Substitute both and divide by −nF:
−nFE = −nFE° + RT ln Q
E = E° − (RT / nF) ln Q
OpenStax uses the same links in the other direction. Its worked example for an iron and silver cell takes E°cell = +1.247 V and n = 2, and gets K = 1.3 × 10⁴² from E° = (0.0592 V/n) log K, then ΔG° = −240.6 kJ/mol from ΔG° = −nFE°. Setting E = 0 and Q = K in the Nernst equation gives exactly that relation, so the Nernst equation, the free energy and the equilibrium constant are three views of one fact.
The constants, from CODATA and the SI
NIST's CODATA pages list the Faraday constant as 96 485.332 12... C mol⁻¹ and the molar gas constant as 8.314 462 618... J mol⁻¹ K⁻¹, each with the uncertainty marked "exact". Both are exact because of the 2019 revision of the SI, recorded in the 9th edition of the BIPM's SI Brochure, which fixed the numerical values of seven defining constants. Three of them matter here. The elementary charge is exactly 1.602 176 634 × 10⁻¹⁹ C, the Avogadro constant exactly 6.022 140 76 × 10²³ mol⁻¹ and the Boltzmann constant exactly 1.380 649 × 10⁻²³ J K⁻¹. Then:
F = e × N_A = 96 485.332 12... C/mol
R = k × N_A = 8.314 462 618... J/(mol·K)
F/R = e/k (so RT/F = kT/e)
The last line is the bridge between chemistry and physics. Chemists write RT/F per mole; semiconductor and nerve physiologists write kT/e per particle. They are the same 25.69 mV at 25 °C. We checked both products in Python: e × N_A gives 96 485.332 12 and k × N_A gives 8.314 462 618, matching NIST to the last printed digit.
Who derived the Nernst equation, and when?
Walther Nernst was born on 25 June 1864 in Briesen, Prussia (now Wąbrzeźno, Poland) and died on 18 November 1941, according to the Nobel Foundation. His Nobel biography records that he studied physics and mathematics at Zurich, Berlin and Graz, where he worked with Ludwig Boltzmann, and graduated at Würzburg in 1887 under Friedrich Kohlrausch with a thesis on electromotive forces produced by magnetism in heated metal plates.
The equation comes from his 1889 paper "Die elektromotorische Wirksamkeit der Jonen" (the electromotive activity of ions), Zeitschrift für Physikalische Chemie, volume 4, pages 129 to 181, per its Crossref record. The Nobel biography summarises the idea: in 1889 he "elucidated the theory of galvanic cells" by assuming an electrolytic pressure of dissolution that pushes ions from an electrode into solution, opposed by the osmotic pressure of the ions already dissolved. When the two balance, the electrode sits at a definite potential, and that potential depends on the logarithm of the ion concentration. A follow-up by Nernst and a coauthor named Pauli, "Weiteres zur electromotorischen Wirksamkeit der Ionen", appeared in Annalen der Physik in 1892.
The modern form, with activities and the reaction quotient, came later as chemical thermodynamics was rebuilt around Gibbs free energy, but the logarithmic dependence on concentration is Nernst's.
Nernst's Nobel Prize in Chemistry 1920 was awarded "in recognition of his work in thermochemistry". The Nobel Foundation notes that he received it one year later, in 1921. The thermochemistry in question is mainly his heat theorem of 1906, which the Nobel biography describes as the Third Law of Thermodynamics. So, as with Svante Arrhenius and his equation, the famous formula is not what the Nobel was for.
Timeline
| Year | Event | Source |
|---|---|---|
| 1836 | John Frederic Daniell describes his constant voltaic cell in a letter to Michael Faraday, Philosophical Transactions, pages 107 to 124 | Crossref record |
| 1864 | Walther Nernst born, 25 June, in Briesen, Prussia | Nobel Foundation |
| 1887 | Nernst graduates at Würzburg under Kohlrausch | Nobel Foundation |
| 1889 | "Die elektromotorische Wirksamkeit der Jonen", Z. Phys. Chem. 4, 129 to 181 | Crossref record; Nobel Foundation |
| 1892 | Nernst and Pauli, follow-up paper in Annalen der Physik 281, 353 to 359 | Crossref record |
| 1906 | Nernst develops his heat theorem (Third Law of Thermodynamics) | Nobel Foundation |
| 1921 | Nernst receives the Nobel Prize in Chemistry 1920 for his work in thermochemistry | Nobel Foundation |
| 1943 | David Goldman publishes the constant field treatment of membrane potentials, J. Gen. Physiol. 27, 37 to 60 | Goldman 1943 (PMC) |
| 1949 | Hodgkin and Katz apply it to the squid giant axon, J. Physiol. 108, 37 to 77 | Crossref record |
| 2002 | IUPAC Recommendations on the measurement of pH, Pure Appl. Chem. 74, 2169 to 2200 | Crossref record |
| 2019 | SI revision fixes e, N_A and k, making F and R exact | BIPM; NIST CODATA |
What are standard electrode potential, the reaction quotient, F and R?
Standard electrode potential E°
You cannot measure the potential of one electrode on its own; a voltmeter needs two terminals. So chemists agreed on a zero. The standard hydrogen electrode, platinum in contact with hydrogen gas at 1 bar and hydrogen ions at unit activity, is assigned exactly 0 V. Every other half cell is measured against it, and the result, written as a reduction, is its standard reduction potential. OpenStax section 17.3 defines the standard cell potential as the potential "measured when both half-cells are under standard-state conditions (1 M concentrations, 1 bar pressures, 298 K)", and gives the rule:
E°cell = E°cathode − E°anode
Both values are reduction potentials. You do not flip the sign of the anode value and then add; the subtraction already does that.
A strict note on the standard state. IUPAC defines it through unit activity, with solute concentrations referenced to 1 mol/kg, and does not fix a temperature, although tabulated values are almost always for 25 °C. Introductory books use 1 M and 298 K as a practical stand-in. For dilute aqueous solutions the difference is small next to the activity corrections discussed below.
The reaction quotient Q
For a reaction aA + bB → cC + dD, the reaction quotient is:
Q = (a_C^c · a_D^d) / (a_A^a · a_B^b)
where each a is an activity. Pure solids and pure liquids have activity 1 and drop out, which is why the Daniell cell's Q is only a ratio of two ion concentrations. Gases enter as partial pressure in bar. Dissolved species enter as concentration in mol/L in the simple treatment, or as concentration multiplied by an activity coefficient γ in the careful one.
Activities versus concentrations
Ions in solution do not behave independently. Each is surrounded by a cloud of opposite charge, which lowers its effective concentration. The activity coefficient γ captures that. In very dilute solutions γ is close to 1. At ionic strengths found in seawater, blood plasma or battery electrolytes it can be well below 1, and it differs between ions. For the worked examples below we use concentrations, as introductory texts do, and flag where that matters. The pH section is the place where it matters most, because pH is formally defined through hydrogen ion activity, not concentration; the IUPAC 2002 recommendations on pH measurement set out how that definition is turned into a measurement scale using primary buffer standards.
The Faraday constant F
F is the charge on one mole of electrons. It converts a chemical amount, moles of electrons, into an electrical one, coulombs. Michael Faraday's laws of electrolysis, from the 1830s, showed that the amount of substance deposited at an electrode is proportional to the charge passed; F is the proportionality constant. With F you can convert a cell voltage into energy per mole: ΔG = −nFE.
The molar gas constant R
R converts temperature into energy per mole. In the Nernst equation RT is the thermal energy scale that a concentration difference has to be weighed against. The higher the temperature, the more voltage the same concentration ratio produces, because random thermal motion pushes harder against an electric field.
Table of standard reduction potentials for common half reactions
All values below are at 25 °C, from OpenStax Chemistry 2e, Appendix L, written as reductions. Strong oxidising agents sit at the top, strong reducing agents at the bottom.
| Half reaction (reduction) | E° (V) | Where you meet it |
|---|---|---|
| F₂ + 2e⁻ → 2F⁻ | +2.866 | Strongest common oxidiser |
| Cl₂ + 2e⁻ → 2Cl⁻ | +1.35827 | Chlorine chemistry, chlor-alkali cells |
| O₂ + 4H⁺ + 4e⁻ → 2H₂O | +1.229 | Fuel cell cathode, water splitting |
| Ag⁺ + e⁻ → Ag | +0.7996 | Silver plating, older batteries |
| Fe³⁺ + e⁻ → Fe²⁺ | +0.771 | Redox titrations |
| Cu²⁺ + 2e⁻ → Cu | +0.337 | Daniell cell cathode, electroplating |
| Hg₂Cl₂ + 2e⁻ → 2Hg + 2Cl⁻ | +0.26808 | Calomel reference electrode |
| AgCl + e⁻ → Ag + Cl⁻ | +0.22233 | Silver chloride reference electrode, inside most pH probes |
| 2H₃O⁺ + 2e⁻ → H₂ + 2H₂O | 0.00 | Standard hydrogen electrode, the defined zero |
| Pb²⁺ + 2e⁻ → Pb | −0.1262 | Lead chemistry |
| PbSO₄ + 2e⁻ → Pb + SO₄²⁻ | −0.3505 | Lead acid battery negative plate |
| Ni²⁺ + 2e⁻ → Ni | −0.257 | Nickel plating |
| Fe²⁺ + 2e⁻ → Fe | −0.447 | Corrosion of iron and steel |
| Zn²⁺ + 2e⁻ → Zn | −0.7618 | Daniell cell anode, galvanising, alkaline cells |
| 2H₂O + 2e⁻ → H₂ + 2OH⁻ | −0.8277 | Hydrogen evolution in alkaline water |
| Al³⁺ + 3e⁻ → Al | −1.662 | Aluminium |
| Mg²⁺ + 2e⁻ → Mg | −2.372 | Sacrificial anodes |
| Na⁺ + e⁻ → Na | −2.71 | Sodium-ion chemistry |
| K⁺ + e⁻ → K | −2.931 | Potassium |
| Li⁺ + e⁻ → Li | −3.04 | Lithium metal, the reason lithium cells reach high voltages |
Two cautions. First, different compilations disagree in the third decimal place for some couples, because they come from different measurements and different conventions; copper is one that varies between tables. Use one table consistently within a calculation and cite it. Second, a standard potential says what is thermodynamically favoured, not how fast it happens. Rates are a separate question, which is where the Arrhenius equation and electrode kinetics come in.
Worked example 1: a Daniell cell away from standard conditions
The Daniell cell is zinc in zinc sulfate, copper in copper sulfate, joined by a salt bridge or porous barrier. Daniell described it in 1836 in a letter to Faraday published in the Philosophical Transactions. Its selling point was a steadier voltage than earlier voltaic piles, and it remains the standard classroom example of a galvanic cell.
Step 1: write the half reactions and E°
Cathode (reduction): Cu²⁺(aq) + 2e⁻ → Cu(s) E° = +0.337 V
Anode (oxidation): Zn(s) → Zn²⁺(aq) + 2e⁻ E°(Zn²⁺/Zn) = −0.7618 V
Overall: Zn(s) + Cu²⁺(aq) → Zn²⁺(aq) + Cu(s)
E°cell = 0.337 − (−0.7618) = 1.0988 V
n = 2
Step 2: write Q
Zinc and copper metals are pure solids, activity 1. So:
Q = [Zn²⁺] / [Cu²⁺]
Step 3: put numbers in
Case A: zinc sulfate at 0.010 M, copper sulfate at 1.0 M, 25 °C. Q = 0.010.
E = 1.0988 − (0.025693 / 2) × ln(0.010)
= 1.0988 − 0.012847 × (−4.6052)
= 1.0988 + 0.0592
= 1.1580 V
A small Q means few products and plenty of reactant, so the cell pushes harder than standard. The voltage rises by 59.2 mV.
Case B: swap them. Zinc at 1.0 M, copper at 0.010 M. Q = 100.
E = 1.0988 − 0.012847 × ln(100) = 1.0988 − 0.0592 = 1.0396 V
Case C: zinc at 0.10 M, copper at 0.0010 M. Q is again 100, so E is again 1.0396 V. Only the ratio matters, not the absolute level, as long as concentrations stand in for activities.
Case D: a cell near the end of its life, zinc at 1.0 M and copper down to 1.0 × 10⁻⁶ M. Q = 10⁶.
E = 1.0988 − 0.012847 × ln(10⁶) = 1.0988 − 0.1775 = 0.9213 V
A millionfold change in Q costs only 177 mV. This is why many batteries hold a fairly flat voltage for most of their discharge and then fall away sharply: the logarithm is forgiving until the reactant is nearly gone, and in a real cell other losses take over at the end.
Step 4: check temperature
At 37 °C, RT/F is 26.727 mV. Case A becomes 1.0988 + (0.026727/2) × 4.6052 = 1.1603 V, and case B becomes 1.0373 V. Note one simplification: we kept E° fixed at its 25 °C value. Strictly, E° itself changes with temperature through the reaction entropy, so for precise work you need E° at the temperature of interest, not just a new RT/F.
Step 5: link to energy and equilibrium
ΔG° = −nFE° = −2 × 96 485.33 × 1.0988 = −212.0 kJ/mol
log K = nE° / 0.05916 = 2 × 1.0988 / 0.05916 = 37.15
K = 1.4 × 10³⁷
The equilibrium constant is so large that the reaction runs essentially to completion. The cell stops delivering useful voltage when the copper ions are effectively used up, not when Q reaches K in any practical sense.
A concentration cell: voltage from concentration alone
Put copper electrodes in both compartments, one with 1.0 M copper sulfate and one with 0.010 M. E° is zero, because both half cells are the same couple. All the voltage comes from Q:
E = 0 − (0.025693 / 2) × ln(0.010 / 1.0) = +0.0592 V
Sixty millivolts from nothing but a hundredfold concentration difference. That is the same physics a nerve cell uses, and the same physics a pH electrode measures.
Worked example 2: why a pH electrode gives about 59 mV per pH unit
How a glass pH electrode works
A combination pH electrode has two halves. The measuring half is a thin bulb of special glass whose surface exchanges hydrogen ions with the solution. A potential develops across the glass that depends on the ratio of hydrogen ion activity outside the bulb to the fixed activity in the filling solution inside. The reference half, usually a silver wire coated in silver chloride in a chloride solution (E° = +0.22233 V in the table above), supplies a stable potential to measure against. The meter reads the difference with almost no current, because the glass has a very high resistance.
For a membrane that responds only to hydrogen ions, the Nernst equation with n = 1 gives:
E = E_const + (RT/F) · ln a(H⁺)
= E_const − (RT · ln 10 / F) · pH
because pH = −log a(H⁺). OpenStax section 14.2 gives the concentration version, pH = −log[H₃O⁺], and the formal definition uses activity. E_const lumps together the reference electrode, the inner filling and the asymmetry of the glass. The slope is (RT ln 10)/F: 59.16 mV per pH unit at 25 °C, from the table above. That is the "about 59 mV" in the title of this section.
Most combination electrodes are built so that they read close to 0 mV at pH 7, and the sign is arranged so that acidic solutions give positive millivolts. So at 25 °C an ideal electrode reads about +177 mV at pH 4 and about −177 mV at pH 10.
Step by step: reading a sample
An ideal electrode at 25 °C reads +118 mV in a sample. The pH is:
pH = 7 − (118 mV / 59.16 mV) = 7 − 1.995 = 5.00
Step by step: two point calibration
Real glass electrodes are close to Nernstian but not exact, and they drift. A meter learns the real slope and offset from two buffers. These readings are illustrative:
| Buffer pH at 25 °C | Reading (mV) |
|---|---|
| 7.00 | −3.0 |
| 4.01 | +168.0 |
Slope = (168.0 − (−3.0)) / (4.01 − 7.00) = −57.19 mV per pH
Slope as % of theoretical = 57.19 / 59.16 = 96.7 %
Offset at pH 7 = −3.0 mV
A sample now reads +60.0 mV:
pH = 7.00 + (60.0 − (−3.0)) / (−57.19) = 7.00 − 1.10 = 5.90
Had we assumed the ideal 59.16 mV slope and a zero offset, we would have reported 7 − 60/59.16 = 5.99. A tenth of a pH unit is a large error in many labs. That is why meters display the slope percentage after calibration and why a probe whose slope keeps falling is due for cleaning or replacement. Meter manuals give their own acceptance limits; follow the manual for your instrument.
How temperature changes the slope
The slope is proportional to absolute temperature. From the thermal voltage table: 56.18 mV per pH at 10 °C, 59.16 at 25 °C, 62.14 at 40 °C, 64.12 at 50 °C. Suppose a sample truly at pH 4.00 sits at 40 °C. An ideal electrode reads (7 − 4) × 62.14 = 186.4 mV. A meter without temperature compensation, assuming the 25 °C slope, reports:
pH = 7 − 186.4 / 59.16 = 3.85
An error of 0.15 pH units, from temperature alone. Automatic temperature compensation, a thermistor in or beside the probe, fixes this by recomputing the slope at the measured temperature.
What compensation does not fix is the sample itself. Buffers and real solutions change their actual pH with temperature, because dissociation constants change. A meter with perfect compensation tells you the pH of the sample at the temperature it is at. Report the temperature with every pH value, and calibrate with buffers at the same temperature as the samples, using the buffer's pH at that temperature from its certificate.
Why the electrode is not perfect
- Sodium error. At high pH and high sodium concentration, the glass responds slightly to sodium ions as well as hydrogen ions, and reads low. Special glasses reduce this.
- Acid error. At very low pH some glasses read high.
- Junction potentials. Where the reference electrolyte meets the sample, a small extra potential forms. It changes with sample composition, which is why a probe can be well calibrated in buffers and still drift in an unusual sample.
- Slow response. A dry or dirty glass bulb responds slowly and gives a low slope. Storage solution keeps the hydrated layer in shape.
The same Nernstian logic, with n set by the ion's charge, underlies other ion selective electrodes, for fluoride, sodium, potassium or calcium. A calcium electrode has n = 2, so its ideal slope is half, 29.58 mV per decade at 25 °C.
Worked example 3: the resting potential of a neuron
The Nernst potential for one ion
A cell membrane separates two salt solutions of different composition. Pumps, principally the sodium and potassium pump, keep potassium high inside and sodium high outside. If the membrane let only potassium through, potassium would leak out down its concentration gradient, leaving behind uncompensated negative charge, until the inside was negative enough to stop further net flow. That balancing voltage is the potassium equilibrium potential, and it is a Nernst equation written for a membrane:
E_ion = (RT / zF) · ln([ion]outside / [ion]inside)
Physiologists write it this way round, with z the ion's charge (+1 for K⁺, −1 for Cl⁻, +2 for Ca²⁺), and give the voltage of the inside relative to the outside. It is exactly the concentration cell from worked example 1.
Numbers for a mammalian neuron
The HST.131 Introduction to Neuroscience course, run by the Harvard-MIT Division of Health Sciences and Technology and published on MIT OpenCourseWare, uses these concentrations in its first problem set (in mM):
| Ion | Inside | Outside | z | E at 22 °C (course answer key) | E at 37 °C (course answer key) | Our recomputation at 37 °C |
|---|---|---|---|---|---|---|
| K⁺ | 137 | 5 | +1 | −84.1 mV | −88.4 mV | −88.5 mV |
| Na⁺ | 9 | 140 | +1 | +69.7 mV | +73.3 mV | +73.3 mV |
| Cl⁻ | 8 | 115 | −1 | −67.7 mV | −71.1 mV | −71.2 mV |
| Ca²⁺ | 0.0001 | 1.8 | +2 | +124.4 mV | +130.8 mV | +130.9 mV |
The answer key uses RT/F = 25.4 mV at 22 °C; we used the exact constants, which accounts for the 0.1 mV differences.
Potassium, step by step, at 37 °C:
RT/F = 8.314 462 618 × 310.15 / 96 485.332 12 = 0.026727 V
E_K = 0.026727 × ln(5 / 137)
= 0.026727 × (−3.3105)
= −0.08848 V ≈ −88.5 mV
With the base 10 shortcut at 37 °C: 61.54 mV × log(5/137) = 61.54 × (−1.4377) = −88.5 mV. Same answer.
The same course lists a squid giant axon with 380 mM potassium inside and 15 mM outside. The key gives −82.1 mV with its 22 °C factor and −78.8 mV at 10 °C, seawater temperature. The concentrations are very different from a mammal's, but the ratios are similar, so the potentials are similar. As the key notes, the potential depends on the logarithm of the ratio, so small changes in the ratio barely move it.
Why the real resting potential is not −88 mV
OpenStax Biology 2e puts a typical neuron's resting potential at about −70 mV and notes that the number "varies by neuron type and by species". OpenStax Anatomy and Physiology 2e gives the same −70 mV and attributes it to leakage channels that let sodium creep in and potassium creep out, with the pump restoring both. A resting membrane is mostly but not only permeable to potassium. A little sodium leaks in, pulling the voltage up from −88 mV towards sodium's +73 mV. Chloride, with its own equilibrium near −71 mV, adds its share.
The Goldman equation
David Goldman's 1943 paper in the Journal of General Physiology treated ion movement through a membrane under both diffusion and an electric field, and the abstract records that the constant field assumption gave "very good agreement with the membrane potential data" of the squid giant axon. Alan Hodgkin and Bernard Katz applied the result to the squid axon in their 1949 paper in the Journal of Physiology, and the combined result is usually called the Goldman Hodgkin Katz (GHK) voltage equation. For potassium, sodium and chloride:
RT P_K[K⁺]o + P_Na[Na⁺]o + P_Cl[Cl⁻]i
V_rest = ──── ln ─────────────────────────────────────
F P_K[K⁺]i + P_Na[Na⁺]i + P_Cl[Cl⁻]o
Each ion is weighted by its permeability P. Chloride's inside and outside are swapped because its charge is negative. If only one P is non-zero, the equation collapses back to the Nernst potential for that ion.
The relative resting permeabilities usually quoted from Hodgkin and Katz's squid axon work are P_K to P_Na to P_Cl of 1 to 0.04 to 0.45. Plugging those into the mammalian concentrations from the table, at 37 °C:
numerator = 1(5) + 0.04(140) + 0.45(8) = 5 + 5.6 + 3.6 = 14.20
denominator = 1(137) + 0.04(9) + 0.45(115) = 137 + 0.36 + 51.75 = 189.11
V_rest = 26.727 mV × ln(14.20 / 189.11) = 26.727 × (−2.589) = −69.2 mV
That lands close to the textbook −70 mV. Mixing squid permeability ratios with mammalian concentrations is a teaching shortcut, not a measurement, so treat −69.2 mV as an illustration of how the equation behaves rather than a property of any particular cell.
The equation also explains the action potential in outline. When voltage gated sodium channels open, P_Na rises far above P_K. Set the ratio to 1 to 20 to 0.45 as an illustration and the same formula gives about +54 mV, moving towards sodium's equilibrium potential of +73 mV. The spike's peak sits below E_Na for the same reason the resting potential sits above E_K: no ion ever has the membrane entirely to itself.
How sensitive is the resting potential to outside potassium?
Because E_K depends on log([K⁺]o/[K⁺]i), changes in extracellular potassium shift it noticeably. Holding inside potassium at 137 mM at 37 °C:
| Outside K⁺ (mM) | E_K (mV) |
|---|---|
| 2.5 | −107.0 |
| 5 | −88.5 |
| 7.5 | −77.6 |
| 10 | −70.0 |
| 20 | −51.4 |
Doubling outside potassium from 5 to 10 mM moves E_K by 18.5 mV, which is one tenfold step's 61.54 mV multiplied by log 2. This is the arithmetic physiologists use to reason about excitable tissue. It is not clinical guidance; potassium disorders are a medical matter for clinicians, and nothing here should be used to interpret anyone's test results.
What the Nernst and Goldman equations leave out
- The pump. The sodium and potassium pump moves three sodium ions out for two potassium ions in, a small net current that makes the inside a few millivolts more negative than GHK predicts. GHK assumes no net current.
- Changing concentrations. Both equations treat concentrations as fixed. During intense activity, potassium can accumulate in narrow spaces outside cells.
- Constant field. Goldman's constant field assumption is an approximation of the voltage profile within the membrane, and his own abstract describes agreement for artificial membranes as of the right order of magnitude only.
- Activities. Intracellular fluid is concentrated and crowded; activity coefficients are well below 1.
Worked example 4: lithium-ion open circuit voltage and state of charge
What OCV is
The open circuit voltage (OCV) of a battery is the voltage across its terminals after it has rested with no current long enough for internal gradients to relax. It is the equilibrium voltage of the cell at its present state of charge (SOC), the fraction of usable capacity remaining. It is what the Nernst equation describes: the free energy of the cell reaction per unit charge, under the actual composition of the electrodes.
OpenStax section 17.5 writes the classic lithium cobalt oxide cell as lithium ions shuttling between a layered oxide cathode and a graphite anode:
Cathode: Li₁₋ₓCoO₂ + x Li⁺ + x e⁻ ⇌ LiCoO₂
Anode: LiₓC₆ ⇌ x Li⁺ + x e⁻ + C₆
Neither electrode contains a dissolved ion at a fixed concentration. The "concentration" that changes is the fraction of lattice sites in each solid that hold lithium. As the cell charges, lithium leaves the cathode and enters the graphite; as it discharges, the reverse.
An idealised Nernst-like model
If lithium ions sat on a lattice of identical sites without interacting, the electrode potential would follow a Nernst-like law in the filled fraction x:
E(x) = E° + (RT/F) · ln((1 − x) / x)
This is an idealisation we use for illustration, not a model of any commercial cell. At 25 °C it gives:
| Filled fraction x | Term (RT/F) ln((1 − x)/x) |
|---|---|
| 0.05 | +75.7 mV |
| 0.10 | +56.5 mV |
| 0.25 | +28.2 mV |
| 0.50 | 0.0 mV |
| 0.75 | −28.2 mV |
| 0.90 | −56.5 mV |
| 0.95 | −75.7 mV |
Across 10 to 90 percent filling, the ideal term moves only about 113 mV. Real lithium-ion electrodes behave very differently. Ions interact with each other and with the host lattice; some electrodes pass through separate phases as they fill, so two phases coexist and the potential stays nearly fixed while the proportions change; graphite fills in stages. The real OCV curve has slopes, plateaus and steps that no single Nernst term reproduces.
What real OCV curves look like, qualitatively
- Layered oxide cathodes, such as the nickel manganese cobalt family, give an OCV curve that slopes fairly steadily with SOC. A voltage reading says a lot about charge.
- Lithium iron phosphate (LFP) cathodes give a famously flat plateau across most of the SOC range, because the electrode is a two phase system. A 2025 iScience paper on online OCV identification notes that its method works only where the OCV and SOC curve is steep and that for "LIBs with a flat OCV-SOC curve, such as LFP batteries, additional constraints are required."
- Hysteresis. Some chemistries rest at a slightly different voltage after charging than after discharging at the same SOC, which adds uncertainty.
- Temperature. The entropic term means OCV at a given SOC shifts slightly with temperature, the same physics as the RT in Nernst, plus the temperature dependence of E°.
Why battery management systems use lookup tables
A battery management system (BMS) has to estimate SOC continuously. It counts charge in and out (coulomb counting), but that drifts, so it periodically corrects itself using voltage. Because no closed form equation matches a real cell's OCV curve, engineers measure the curve on sample cells, for example by charging or discharging in small steps and resting at each one, and store the result as a table of SOC and OCV points. The 2025 iScience study measured OCV at 5 percent SOC intervals in an incremental test. A 2026 Scientific Reports study of OCV estimation methods states that its estimator obtains OCV values from lookup tables, with piecewise linear interpolation between breakpoints, a choice it says reflects "widespread adoption in practical Battery Management Systems".
So the Nernst equation explains why OCV rises with SOC and why it shifts with temperature. The lookup table supplies the actual shape. The table becomes part of the BMS firmware or its configuration, which is where the software side of this post begins.
A quick worked check with a table
Suppose an illustrative table for one cell includes the points 40 percent SOC at 3.640 V and 50 percent SOC at 3.680 V (illustrative values, not a real datasheet). After a long rest the cell reads 3.665 V. Linear interpolation gives:
SOC = 40 + (3.665 − 3.640) / (3.680 − 3.640) × 10 = 40 + 0.625 × 10 = 46.25 %
Now do the same on a flat LFP plateau where a 10 percent SOC step might move OCV by only a few millivolts. A 2 mV measurement error, trivial on the sloped curve above, could then shift the estimate by several percent of SOC. That is the practical reason LFP packs lean harder on coulomb counting and on recalibration near full or empty, where the curve finally bends.
Comparison: Nernst, Goldman and related equations
| Equation | What it gives | Assumes | Typical use |
|---|---|---|---|
| Nernst (cell form) | Cell voltage at any composition | Equilibrium, zero current, known activities | Battery chemistry, corrosion, redox titrations |
| Nernst (membrane form) | Equilibrium potential of one ion across a membrane | Membrane permeable to that ion only | Physiology, ion selective electrodes |
| Goldman Hodgkin Katz | Membrane potential with several permeant ions | Constant field, no net current, independent ions | Resting and peak membrane potentials |
| Extended Nernst with selectivity terms | Electrode response when interfering ions are present | Selectivity coefficients known | Sodium error in pH glass, ion selective electrodes |
| ΔG = −nFE | Free energy from voltage | Reversible conditions | Energy stored in a cell |
| E° = (RT/nF) ln K | Equilibrium constant from standard potential | Standard states | Predicting how far a redox reaction goes |
| OCV lookup table | Equilibrium voltage of a real cell at each SOC | Measured on representative cells | Battery management systems |
Decision table: which form should I use?
| Your situation | Use |
|---|---|
| Two half cells, one temperature of 25 °C, quick estimate | E = E° − (0.05916/n) log Q |
| Any other temperature | E = E° − (RT/nF) ln Q with T in kelvin, and E° at that temperature if available |
| Concentrated or high ionic strength solutions | Activities: multiply concentrations by activity coefficients |
| One ion across a membrane | Membrane Nernst form with z |
| Several ions across a membrane | Goldman Hodgkin Katz |
| A glass or ion selective electrode in a messy sample | Calibrate in matching standards; consider the extended form with selectivity |
| A real lithium-ion cell | The measured OCV and SOC table from the cell maker or your own tests |
Walkthrough: reproduce every number in Python
All the numbers above come from a short script that uses only the Python standard library. Here is how to rebuild it in a clean environment.
Step 1: create an isolated environment
mkdir nernst && cd nernst
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
pip freeze > requirements.txt # empty for now: the script uses only the standard library
Step 2: write the calculations
Save this as nernst.py:
import math
# CODATA values, exact since the 2019 SI revision (NIST)
R = 8.314462618 # J mol^-1 K^-1
F = 96485.33212 # C mol^-1
def kelvin(celsius):
return celsius + 273.15
def thermal_voltage(celsius):
"""RT/F in volts."""
return R * kelvin(celsius) / F
def nernst(e_standard, n, q, celsius=25.0):
"""Cell potential E = E0 - (RT/nF) ln Q, in volts."""
return e_standard - thermal_voltage(celsius) / n * math.log(q)
def ion_potential(inside, outside, z, celsius=37.0):
"""Membrane equilibrium potential in mV, inside relative to outside."""
return 1000 * thermal_voltage(celsius) / z * math.log(outside / inside)
def ghk(p, inside, outside, celsius=37.0):
"""Goldman Hodgkin Katz voltage for K, Na, Cl in mV."""
num = p["K"] * outside["K"] + p["Na"] * outside["Na"] + p["Cl"] * inside["Cl"]
den = p["K"] * inside["K"] + p["Na"] * inside["Na"] + p["Cl"] * outside["Cl"]
return 1000 * thermal_voltage(celsius) * math.log(num / den)
# Slope table
for c in (0, 10, 20, 25, 37, 50, 80):
print(f"{c:>3} C RT/F {1000*thermal_voltage(c):.3f} mV "
f"slope {1000*math.log(10)*thermal_voltage(c):.2f} mV/decade")
# Worked example 1: Daniell cell (OpenStax Appendix L values)
e0 = 0.337 - (-0.7618)
for zn, cu in ((0.010, 1.0), (1.0, 0.010), (0.10, 0.0010), (1.0, 1e-6)):
print(f"Zn {zn} M, Cu {cu} M: E = {nernst(e0, 2, zn / cu):.4f} V")
print(f"log K = {2 * e0 / (math.log(10) * thermal_voltage(25)):.2f}")
# Worked example 2: pH calibration (illustrative readings)
slope = (168.0 - (-3.0)) / (4.01 - 7.00)
ideal = 1000 * math.log(10) * thermal_voltage(25)
print(f"slope {slope:.2f} mV/pH, {abs(slope) / ideal * 100:.1f} % of ideal")
print(f"sample at +60 mV: pH {7.00 + (60.0 - (-3.0)) / slope:.2f}")
# Worked example 3: neuron (HST.131 problem set concentrations, mM)
inside = {"K": 137, "Na": 9, "Cl": 8}
outside = {"K": 5, "Na": 140, "Cl": 115}
print(f"E_K {ion_potential(137, 5, +1):.1f} mV")
print(f"E_Na {ion_potential(9, 140, +1):.1f} mV")
print(f"E_Cl {ion_potential(8, 115, -1):.1f} mV")
print(f"GHK rest {ghk({'K': 1, 'Na': 0.04, 'Cl': 0.45}, inside, outside):.1f} mV")
Step 3: run it and compare
python nernst.py
Expected output, abbreviated:
25 C RT/F 25.693 mV slope 59.16 mV/decade
37 C RT/F 26.727 mV slope 61.54 mV/decade
Zn 0.01 M, Cu 1.0 M: E = 1.1580 V
Zn 1.0 M, Cu 0.01 M: E = 1.0396 V
Zn 1.0 M, Cu 1e-06 M: E = 0.9213 V
log K = 37.15
slope -57.19 mV/pH, 96.7 % of ideal
sample at +60 mV: pH 5.90
E_K -88.5 mV
E_Na 73.3 mV
E_Cl -71.2 mV
GHK rest -69.2 mV
If any line differs, check three things first: that temperature is in kelvin inside thermal_voltage, that math.log is the natural logarithm (it is; math.log10 is base 10), and that n or z is right for the reaction.
Step 4: add a units sanity test
A cheap guard against the most common mistake is a test that fails if someone passes Celsius where kelvin is expected:
def test_thermal_voltage_25c():
assert abs(thermal_voltage(25) - 0.025693) < 1e-6
def test_slope_25c():
assert abs(1000 * math.log(10) * thermal_voltage(25) - 59.16) < 0.01
Run it with python -m pytest after pip install pytest and pinning the version in requirements.txt.
Step 5: keep the script's dependencies healthy
The moment the script grows into a lab tool, a battery test dashboard or a calibration log, it will pull in plotting, data frame and instrument libraries. Pin them, rebuild the environment from requirements.txt rather than by hand, and scan the project for known vulnerable open source components before you share it:
pip freeze > requirements.txt
safeguard scan --dir .
Results are written as JSON under ./output, so a reviewer or a CI job can pick them up.
Common mistakes
- Mixing log bases. 0.05916 V goes with log₁₀. RT/F goes with ln. Using 0.0592 with a natural log overstates the correction by a factor of 2.303. For the Daniell case A, that error turns a +59.2 mV correction into +136 mV.
- Using Celsius. T must be in kelvin. RT/F with T = 25 gives 2.15 mV instead of 25.69 mV, an answer twelve times too small.
- Using the 25 °C constant at other temperatures. 0.05916 V is only for 298.15 K. At 37 °C the slope is 61.54 mV per decade, about 4 percent larger.
- Wrong n. n is the electrons transferred in the balanced overall reaction, not in either half reaction before balancing. For the iron and silver cell in OpenStax, silver's half reaction moves one electron but the balanced reaction moves two.
- Flipping the anode's sign twice. E°cell = E°cathode − E°anode with both as reduction potentials. Do not also reverse the anode value.
- Inverting Q. Q is products over reactants for the reaction as written. If you write the reaction the other way round, both E° and ln Q change sign together.
- Including solids and pure liquids in Q. They have activity 1.
- Forgetting activities. In concentrated or high ionic strength solutions, concentrations overstate the effective amounts. For pH, the definition is in terms of activity.
- Confusing equilibrium with a working cell. Nernst gives the zero current voltage. Under load, internal resistance and electrode kinetics pull the terminal voltage down; on charge they push it up.
- Treating a calibrated pH meter as temperature proof. Compensation fixes the electrode slope, not the sample's own change in pH with temperature.
- Expecting one Nernst term to describe a real lithium-ion cell. Use the measured OCV curve.
FAQ
What is the Nernst equation in simple terms?
It tells you the voltage of a cell or electrode when concentrations are not at their standard values. Start from the standard potential E°, then correct it by (RT/nF) ln Q, where Q compares how much product you have to how much reactant. More reactant raises the voltage, more product lowers it, and at equilibrium the voltage is zero.
What is 0.0592 in the Nernst equation?
It is (RT/F) × ln 10 at 25 °C, in volts. With exact constants it is 0.059159 V. It lets you use base 10 logarithms: E = E° − (0.05916/n) log Q. It applies only at 25 °C; at 37 °C the equivalent number is 0.06154 V.
How do you find n in the Nernst equation?
Balance the overall redox reaction, then count the electrons that cancel between the two half reactions. For Zn + Cu²⁺ → Zn²⁺ + Cu, n = 2. For Fe + 2Ag⁺ → Fe²⁺ + 2Ag, n = 2 even though each silver ion takes one electron.
Why is a pH electrode 59 mV per pH unit?
Because the glass membrane responds to hydrogen ions, which carry one charge, and pH is a base 10 logarithm of hydrogen ion activity. The Nernst slope for n = 1 is (RT ln 10)/F, which is 59.16 mV at 25 °C. It is 56.18 mV at 10 °C and 62.14 mV at 40 °C, which is why pH meters need temperature compensation.
What is the difference between the Nernst and Goldman equations?
The Nernst equation gives the equilibrium potential for one ion. The Goldman Hodgkin Katz equation gives the membrane potential when several ions can cross, each weighted by its permeability. If only one ion can cross, Goldman reduces to Nernst.
Why is the resting membrane potential about −70 mV and not the potassium equilibrium potential?
Because the resting membrane is mostly but not only permeable to potassium. Small sodium and chloride permeabilities pull the voltage away from E_K, around −88 mV in our example, towards their own equilibrium potentials. With commonly quoted permeability ratios, the Goldman equation gives about −69 mV.
Does the Nernst equation apply to batteries?
Yes, for the equilibrium (open circuit) voltage. It explains why voltage depends on composition and temperature. Real lithium-ion electrodes are solids with interacting lithium sites and phase changes, so their OCV curve is measured and stored as a table rather than computed from one Nernst term.
Does temperature change the standard electrode potential?
Yes. E° depends on temperature through the reaction's entropy change. The Nernst equation's T term handles the concentration correction, but for precise work at temperatures far from 25 °C you need E° at that temperature too.
Why are the Faraday constant and gas constant exact now?
Since the 2019 SI revision, the elementary charge, the Avogadro constant and the Boltzmann constant have fixed exact values. F is the product of the first two and R the product of the last two, so NIST lists both as exact.
Who discovered the Nernst equation?
Walther Nernst, in an 1889 paper on the electromotive activity of ions in Zeitschrift für Physikalische Chemie. He won the Nobel Prize in Chemistry 1920, received in 1921, for his work in thermochemistry, chiefly his 1906 heat theorem.
The software around the chemistry: an honest bridge
The Nernst equation is electrochemistry, and Safeguard does not do electrochemistry. Its models are single purpose security models for software. They do not calculate cell voltages, calibrate pH electrodes, model neurons or estimate state of charge, and nothing in this post was computed by them. The connection is narrower. A battery management system runs firmware that holds its OCV table, its coulomb counter and its safety limits, and it usually talks to companion apps, cloud dashboards and factory test software. Lab pH meters, titrators and data loggers run firmware too and export results into laboratory information systems and analysis scripts. Much of that surrounding code is built from open source dependencies. That is where Safeguard can help: scanning the repositories, container images and SBOM files your team builds for known vulnerable open source components, showing which projects carry a given version, and, when a fixed version exists, opening an upgrade pull request for review. It does not scan device firmware or analyse hardware.
A battery test dashboard rebuilt next month pulls its dependencies again, and the BMS tooling, meter drivers and data pipelines around these instruments ship open source components that age like any other software. The fit is indirect for the chemistry itself, but for the code you build and ship around it the same dependency hygiene applies, and the section below covers how to close the gap whether or not upstream has a fix yet.
Fix it without waiting for upstream
Whatever the vulnerability, most of the risk sits in two gaps. The first is the time between a fix being published and that fix actually running in your production builds. The second, and worse, is the time before any fix exists at all, while a maintainer works out a patch and a release schedule. Waiting through both gaps is a habit, not a requirement. Safeguard gives teams three ways to close them.
1. Autonomous remediation: pull requests, not tickets
When a fixed version exists, Safeguard's Griffin models open a tested, policy gated pull request that moves the affected dependency to the safe version. You can run it on one repository or in bulk across every project that carries the vulnerable version. Remediation covers eight categories, including dependencies, licenses, security posture and findings. Reachability analysis ranks the vulnerable code paths your application actually calls first, so the first pull requests you merge are the ones that matter most. Autonomous remediation ships switched off, with every category set to Manual, so your team decides how much runs on its own and what still needs a human approval.
2. Gold Open Source: the safe version in seconds, free
gold.safeguard.sh is free and needs no login. Search any CVE or package to see affected and fixed versions, CVSS, EPSS, CISA KEV status and a recommended safe version, or use the "Am I affected?" checker. The same data is available through a free read API, README status badges and RSS threat feeds. The safeguard-sh/gold-scan-action GitHub Action can fail a build on a known exploited vulnerability, on any known vulnerability, or never, so a version you have just removed cannot quietly come back in next week's merge.
3. Gold Registry: start from components that are already fixed
registry.safeguard.sh provides hardened, drop in replacements for upstream packages and container images. Every Gold artifact is held continuously to zero exploitable critical or high CVEs, zero malware and a completed license check, with SLSA L3 or higher provenance, a Sigstore signature and a public evidence page you can hand to an auditor. An artifact loses its Gold badge if it regresses. Teams can point their own package directory at the registry so hardened equivalents resolve without changing how developers install anything.
When upstream has no fix yet, or will not ship one, Safeguard first works to get the fix accepted upstream. If the issue is severe or upstream will not move, Safeguard builds a fork, fixes the vulnerability there and publishes a hardened Gold build, so you are not stuck on a maintainer's release schedule. You can also request a hardened, compatibility tested build of a specific package. This fork and patch flow is in early access today, so ask which packages it covers before you plan around it.
| Your situation | What to use |
|---|---|
| A fixed version exists | Autonomous remediation opens the upgrade pull request; Gold Open Source confirms the safe version |
| You need to know today whether you are affected | Gold Open Source lookup and "Am I affected?" checker, free and without login |
| You want vulnerable versions to stop shipping | The Gold scan GitHub Action in CI, plus Safeguard policies and gates |
| Upstream has no fix yet, or will not ship one | A custom Gold request; fork and patch (early access) |
| You want to start clean on new projects | Pull hardened components and images from Gold Registry |
One honest limit: when the vulnerable code lives in a vendor appliance, a hosted service or an operating system runtime you do not build yourself, the fix still has to come from that vendor or distribution. The steps above apply to the open source dependencies and container images you build and ship, which is where most teams carry the largest and least tracked share of their exposure.
See how Safeguard would help
None of these demos involve electrochemistry or any calculation from this post; they show the software side described in the bridge above.
The first demo is a real Safeguard CLI session: it installs the CLI, opens the interactive terminal and asks it to fix a lodash CVE in a repository. It reads the finding and advisory, asks before each command, edits package.json to lodash 4.17.21, runs npm install and npm test with approval, prints a summary and pushes nothing. The same flow applies to a battery monitoring dashboard or a pH data logging web app your team maintains: scan the repository, then let the assistant propose the dependency upgrade under your approval.
Click through it at your own pace, or open it full screen.
The second demo sets up the Safeguard runner on your own machine, approves it with its device code and then scans from the terminal. That suits lab and battery test engineering teams who keep calibration scripts, instrument integration code or cell test tooling on their own hardware and want the scan to run where the code lives.
Click through it at your own pace, or open it full screen.
The third demo connects Claude to the Safeguard MCP server with OAuth and lets you choose which tools Claude can use. For an engineer who already works with Claude while writing a data pipeline for cell test or meter calibration results, it brings dependency findings into the same conversation, limited to the tools you allow.
Click through it at your own pace, or open it full screen.
To try it on your own repositories, download Safeguard and follow the CLI documentation.
Quick check
A Daniell cell has 1.0 M zinc ions and 0.010 M copper ions at 25 °C. What is its voltage, using E° = 1.0988 V?
Q = [Zn²⁺]/[Cu²⁺] = 100 and n = 2, so E = 1.0988 − (0.05916/2) × log 100 = 1.0988 − 0.0592 = 1.0396 V. Less copper ion, the reactant, means less driving force.
A pH meter without temperature compensation measures a sample truly at pH 4.00 and 40 °C. What does it report?
The electrode gives (7 − 4) × 62.14 = 186.4 mV, but the meter divides by the 25 °C slope of 59.16 mV, so it reports 7 − 186.4/59.16 = 3.85. The 0.15 pH error comes entirely from temperature.
With 137 mM potassium inside a cell and 5 mM outside at 37 °C, what is the potassium equilibrium potential?
E_K = (RT/F) ln(5/137) = 26.727 mV × (−3.3105) = −88.5 mV. The inside sits about 88 mV negative to the outside when potassium alone sets the voltage.
Sources
- OpenStax, Chemistry 2e, 17.3 Electrode and Cell Potentials
- OpenStax, Chemistry 2e, 17.4 Potential, Free Energy, and Equilibrium
- OpenStax, Chemistry 2e, 17.5 Batteries and Fuel Cells
- OpenStax, Chemistry 2e, 14.2 pH and pOH
- OpenStax, Chemistry 2e, Appendix L, Standard Electrode (Half-Cell) Potentials
- OpenStax, Biology 2e, 35.2 How Neurons Communicate
- OpenStax, Anatomy and Physiology 2e, 12.4 The Action Potential
- NIST CODATA, Faraday constant
- NIST CODATA, molar gas constant
- NIST CODATA, elementary charge
- NIST CODATA, Avogadro constant
- NIST CODATA, Boltzmann constant
- BIPM, SI Brochure, 9th edition (2019)
- Nobel Foundation, Walther Nernst facts, Nobel Prize in Chemistry 1920
- Nobel Foundation, Walther Nernst biographical
- Crossref record: Nernst, Die elektromotorische Wirksamkeit der Jonen, Z. Phys. Chem. 4 (1889) 129 to 181
- Crossref record: Nernst and Pauli, Weiteres zur electromotorischen Wirksamkeit der Ionen, Ann. Phys. 281 (1892) 353 to 359
- Crossref record: Daniell, On Voltaic Combinations, Phil. Trans. R. Soc. (1836) 107 to 124
- Goldman, Potential, Impedance, and Rectification in Membranes, J. Gen. Physiol. 27 (1943) 37 to 60 (Europe PMC)
- Crossref record: Hodgkin and Katz, The effect of sodium ions on the electrical activity of the giant axon of the squid, J. Physiol. 108 (1949) 37 to 77
- Crossref record: Buck et al., Measurement of pH. Definition, standards, and procedures (IUPAC Recommendations 2002), Pure Appl. Chem. 74 (2002) 2169 to 2200
- MIT OpenCourseWare, HST.131 Introduction to Neuroscience, Problem Set 1 answers (PDF)
- Li et al., Entropy-driven online open circuit voltage identification for precise state estimation in lithium-ion batteries, iScience (2025) (Europe PMC)
- Mikhak-Beyranvand et al., Assessing the impact of open-circuit voltage estimation methods on UKF performance for lithium-ion battery SOC and SOH estimation, Scientific Reports (2026) (Europe PMC)
Last reviewed: 24 October 2026.