# Buffer recipe and pH setpoint

`calc_buffer_recipe` · Runs: On the server · Level: Checked against a reference: a CIAAW 2021 sum in Python's decimal module and Goldberg's equation 12 in NumPy 2.5.3

Works out what to weigh for a buffer and the pH to set so it reads the target pH at working temperature.

Research and education software; not medical advice, and not for diagnosis or treatment decisions. It computes from the inputs it receives. It does not check the person's data, design or sample.

[Catalogue](https://www.drybench.com/mcp/catalogue) / [Solutions](https://www.drybench.com/mcp/catalogue/solutions)

[Ask your assistant](https://www.drybench.com/mcp/connect) · [Open in Drybench Calc](https://www.drybench.com/calculators/app)

```cite
Buffer recipe and pH setpoint (calc_buffer_recipe), Drybench MCP server 1.0.0; buffer-recipe@1.2.2 (Checked against a reference); pka-temperature-goldberg@1.1.0 (Checked against a reference); formula-mass@1.3.0 (Checked against a reference); https://www.drybench.com/mcp/tools/calc-buffer-recipe
```

## What it is

Computes weighed mass (CIAAW 2021) and preparation pH setpoint (Goldberg 2002 equation 12) for supported buffers (tris, hepes, mops, mes, pipes, phosphate-2, etc.). Refuses open CO2 systems, missing weighed form, out-of-range temperatures, target pH too far from pKa or near overlapping steps, or a mass outside double range.

Field: [Solutions](https://www.drybench.com/mcp/catalogue/solutions). It is the same calculation as [Drybench Calc](https://www.drybench.com/calculators/app), called by an AI assistant through the server.

## What it does

**You give**

- `buffer` (required): Buffer and ionisation step id (tris, hepes, mops, mes, pipes, phosphate-2, tes, imidazole, ches, taps, glycine-2, citrate-3, acetate, bicine, tricine, citrate-1, citrate-2, bis-tris, glycylglycine-2, borate, ammonia, ethanolamine, triethanolamine, bes, ada-3, caps, capso, dipso, heppso, tapso, succinate-2, maleate-2).
- `concentration` (required): Target final molar concentration.
- `volume` (required): Target final solution volume.
- `targetPH` (required): Target pH at working temperature.
- `useTemperature` (required): Working temperature in degC.
- `adjustTemperature` (required): Preparation pH-adjustment temperature in degC.

and 1 more, listed below

**A request and its answer**

Asked with

- `buffer`: tris
- `form`: C4H11NO3
- `concentration`: 50 mM
- `volume`: 1 L
- `targetPH`: 7.5 pH
- `useTemperature`: 37 °C
- `adjustTemperature`: 25 °C

It answered (computed)

- `form`: C4H11NO3
- `formulaWeight`: 121.1 g/mol
- `formulaWeightExact`: 121.136
- `mass`: 6.057 g
- `pKaAtUse`: 7.753
- `pKaAtAdjust`: 8.072
- `setpointPH`: 7.819 pH
- `concentration`: 0.05 M

Computed by this tool when the page was built. The steps between are not recorded, so this is not a worked example. The reply carries more values than are shown here. One answer to one request, not a reference value.

**Limits**

- The acid-to-base ratio does not change with temperature; activity coefficients are ignored; the meter reads the solution's pH at the adjusting temperature.
- ΔrCp° is constant over the temperature range (its temperature derivative is left out).
- The material has the isotopic composition of normal terrestrial material, which the standard atomic weights describe; an enriched or unusual sample has a different mass.
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.

Every reply also carries its app's limits line: "The stock, dilution and buffer calculations here are not for dosing or clinical preparation."

**It will not answer when**

- The target pH is more than one unit from pK at the working temperature.
- Another step of the same substance is within two units of the target.
- No weighed form is stated for the buffer.
- Concentration or volume missing or not positive.

### Every input, with its units

7 inputs

- `buffer` (required): Buffer and ionisation step id (tris, hepes, mops, mes, pipes, phosphate-2, tes, imidazole, ches, taps, glycine-2, citrate-3, acetate, bicine, tricine, citrate-1, citrate-2, bis-tris, glycylglycine-2, borate, ammonia, ethanolamine, triethanolamine, bes, ada-3, caps, capso, dipso, heppso, tapso, succinate-2, maleate-2).
- `concentration` (required): Target final molar concentration.
- `volume` (required): Target final solution volume.
- `targetPH` (required): Target pH at working temperature.
- `useTemperature` (required): Working temperature in degC.
- `adjustTemperature` (required): Preparation pH-adjustment temperature in degC.
- `form`: Molecular formula of exact weighed chemical form including salt and hydrate (e.g. 'Na2HPO4.7H2O').

### Every refusal, with its code

9 refusals

| Code | When |
| --- | --- |
| `outside-buffer-range` | The target pH is more than one unit from pK at the working temperature. |
| `overlapping-pk` | Another step of the same substance is within two units of the target. |
| `no-form` | No weighed form is stated for the buffer. |
| `amount` | Concentration or volume missing or not positive. |
| `formula` | The weighed form cannot be read by formula-mass; since 1.2.2, through formula-mass\@1.3.0, a form starting with a digit (13C4H11NO3) among them, which 1.2.1 weighed as 13 × C4H11NO3. |
| `magnitude` | The mass to weigh is outside the normal range of a double (since 1.2.1: 1.2.0 gave 0 g for 1e-162 M Tris in 2e-162 L, a true 2.42272e-322 g). |
| `TEMPERATURE_RANGE` | The working temperature falls outside the range covered by the reference data. |
| `INVALID_FORMULA` | The formula cannot be read: an unknown or misspelt element; an element with no standard atomic weight (Tc, Pm, Po onward); a count, multiplier or charge starting with 0; a zero count, multiplier or written "+0"/"-0"; a count or weight beyond exact integer range; one element with a count and a bare sign ("Fe3+"), refused as ambiguous with "Fe+3" suggested; a formula starting with a digit ("13CH4", "2H2O"), refused at position 0 since 1.3.0 (1.2.0 read the number as a multiplier of the first part). |
| `MISSING_ARGUMENT` | No formula is given. |

## The calculation

3 methods, each with its equations, constants and worked example.

### [Buffer mass of the exact chemical form and the pH-meter setpoint at the preparation temperature](https://www.drybench.com/methods/m/buffer-recipe/1.2.2)

`buffer-recipe@1.2.2`

**Equation 1**

```text
m = C × V × M, M the formula weight of the form weighed (formula-mass@1.3.0).
```

| Symbol | Meaning |
| --- | --- |
| `m` | mass to weigh, g |

**Equation 2**

```text
pH_set(T_adjust) = pH_target(T_use) + pK(T_adjust) − pK(T_use): the acid-to-base ratio set at the adjusting temperature is assumed to hold at the working temperature, so the pH moves with the pK.
```

| Symbol | Meaning |
| --- | --- |
| `pH_set` | the pH to set on the meter at the adjusting temperature, 1 |

**Conventions**

- Convention chosen by this project: a target pH more than one unit from the buffer's pK at the working temperature is refused, and so is a target within two units of another pK of the same substance. A half-unit window would refuse more targets; a wider one would accept targets where the buffer holds little capacity; treating both steps together, instead of refusing, would give a recipe for those targets. The masses and set-point of every accepted recipe are the same under each choice.

A model of nature: it predicts a measurement and can be wrong for your sample. No prediction error is available.

**Worked example**

Worked example: one case of buffer-recipe\@1.2.2, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- buffer = tris
- form = C4H11NO3
- concentration = 50 mM
- volume = 1 L
- targetPH = 7.6
- useTemperatureC = 37
- adjustTemperatureC = 25

**Steps**

1. T: T = t + 273.15 = T\_use = 310.15 K; T\_adjust = 298.15 K = T\_r, from t\_use = 37 °C, t\_adjust = 25 °C.
2. pKuse: Eq. (12): pK(T) = pK(T\_r) − (ΔH/(R ln 10))(1/T\_r − 1/T) − (ΔCp/(R ln 10))(T\_r/T − 1 + ln(T/T\_r)) = 7.75274, from pK(T\_r) = 8.072, ΔH = 47450 J/mol, ΔCp = −59 J/(K·mol), T = 310.15 K.
3. pKadjust: Eq. (12) at T = T\_r = 8.07200.
4. setpoint = 7.91926, taken from pka-temperature-goldberg\@1.1.0, which has a page of its own; gives result.setpointPH.
5. M = 121.1360 g/mol, taken from formula-mass\@1.2.0, which has a page of its own.
6. mass: m = C × V × M = 6.05680 g, from C = 0.050 mol/L, V = 1 L; gives result.massG.

The working, as the case writes it:

```text
pH_set = pH_target + pK(T_adjust) − pK(T_use)
m = C × V × M.
```

**Answer**

- result.setpointPH = 7.91926
- result.massG = 6.05680 g

Where these values came from: our own exact-arithmetic script and a hand-worked case; Goldberg RN, Kishore N, Lennen RM. J Phys Chem Ref Data 2002;31:231-370: Eq. (12) on p. 233; section 8, Tris: pK 8.072, ΔrH° 47.45 kJ/mol, ΔrCp° −59 J/(K·mol); R = 8.31451 J/(K·mol); CIAAW, Abridged Standard Atomic Weights 2024 (ciaaw.org), read 11 November 2026.

The build has not run this example through the tool.

Worked by an AI session on 2026-11-25. No person has yet worked this case.

### [pK at the working temperature](https://www.drybench.com/methods/m/pka-temperature-goldberg/1.1.0)

`pka-temperature-goldberg@1.1.0`

```text
pK(T) = pK(T_r) − (ΔrH°/(R ln 10))(1/T_r − 1/T) − (ΔrCp°/(R ln 10))(T_r/T − 1 + ln(T/T_r)): Goldberg et al.'s Eq. (12), the Clarke and Glew form, with pK = −log10 K, pK(T_r) = ΔrG°/(R T_r ln 10), and the (∂ΔrCp°/∂T)p term left out (the paper gives no values for it).
```

| Symbol | Meaning |
| --- | --- |
| `T_r` | reference temperature, K |
| `ΔrH°` | standard molar enthalpy of ionisation at T\_r, J/mol |
| `ΔrCp°` | standard molar heat-capacity change at T\_r, J/(K.mol) |

Source 1.

| Constant | Value | From |
| --- | --- | --- |
| pK, ΔrH° and ΔrCp° at 298.15 K and I = 0 for 34 ionisation steps `buffers` | a table of values, part of the method | Source 1 |
| Gas constant as the paper uses it `R` | a table of values, part of the method | Source 1 |
| Reference temperature `T_r` | a table of values, part of the method | Source 1 |

A model of nature: it predicts a measurement and can be wrong for your sample. No prediction error is available.

**Worked example**

Worked example: one case of pka-temperature-goldberg\@1.1.0, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- buffer = tris
- form = C4H11NO3
- concentration = 50 mM
- volume = 1 L
- targetPH = 7.6
- useTemperatureC = 37
- adjustTemperatureC = 25

**Steps**

1. T: T = t + 273.15 = T\_use = 310.15 K; T\_adjust = 298.15 K = T\_r, from t\_use = 37 °C, t\_adjust = 25 °C.
2. pKuse: Eq. (12): pK(T) = pK(T\_r) − (ΔH/(R ln 10))(1/T\_r − 1/T) − (ΔCp/(R ln 10))(T\_r/T − 1 + ln(T/T\_r)) = 7.75274, from pK(T\_r) = 8.072, ΔH = 47450 J/mol, ΔCp = −59 J/(K·mol), T = 310.15 K; gives result.pKaAtUse.
3. pKadjust: Eq. (12) at T = T\_r = 8.07200.

The working, as the case writes it:

```text
Goldberg 2002 Eq. (12) rearranged for pK = −log10 K.
```

**Answer**

- result.pKaAtUse = 7.75274

Where these values came from: our own exact-arithmetic script and a hand-worked case; Goldberg RN, Kishore N, Lennen RM. J Phys Chem Ref Data 2002;31:231-370: Eq. (12) on p. 233; section 8, Tris: pK 8.072, ΔrH° 47.45 kJ/mol, ΔrCp° −59 J/(K·mol); R = 8.31451 J/(K·mol).

The build has not run this example through the tool.

Worked by an AI session on 2026-11-11. No person has yet worked this case.

### [Formula weight from the molecular formula](https://www.drybench.com/methods/m/formula-mass/1.3.0)

`formula-mass@1.3.0`

```text
M = Σᵢ nᵢ × A_r(i) g/mol, over every element i in the formula, where nᵢ is the element's count summed over the formula's groups and adducts, each multiplied by its multiplier.
```

| Symbol | Meaning |
| --- | --- |
| `M` | formula weight of the formula as written, salt and hydrate included, g/mol |
| `n_i` | number of atoms of element i in one formula unit, 1 |
| `A_r(i)` | the element's abridged standard atomic weight, used as g/mol, g/mol |

| Constant | Value | From |
| --- | --- | --- |
| Abridged standard atomic weights, 84 elements; an element whose weight is an interval takes the value CIAAW's abridged table prints `A_r` | a table of values, part of the method | Source 2 |

**Conventions**

- Convention chosen by this project: an ASCII '.' with a digit on each side is read as an adduct, never a decimal count, and the reply warns. CuSO4.5H2O is read as CuSO4·5H2O, 249.68 g/mol; read as a decimal, it would be 185.62 g/mol.

A definition, not a model: the equation states what the quantity means. A different convention gives a different number.

**Worked example**

Worked example: one case of formula-mass\@1.3.0, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.

**Inputs**

- formula = CaCl2·2H2O

**Steps**

1. count: counts = Ca 1, Cl 2, H 4, O 2 (the hydrate's 2 multiplies H2O), from formula = CaCl2·2H2O.
2. ca: sum = 40.078 g/mol, from n = 1, A\_r(Ca) = 40.078.
3. cl: sum = 70.9 g/mol, from n = 2, A\_r(Cl) = 35.45.
4. h: sum = 4.032 g/mol, from n = 4, A\_r(H) = 1.0080.
5. o: sum = 31.998 g/mol, from n = 2, A\_r(O) = 15.999.
6. M: sum = 147.008 g/mol, from terms = ca,cl,h,o; gives result.formulaWeightGPerMol.

The working, as the case writes it:

```text
M = Σ nᵢ·A_r(i), each A_r as CIAAW prints it.
```

**Answer**

- result.formulaWeightGPerMol = 147.008 g/mol

Where these values came from: our own exact-arithmetic script and a hand-worked case; CIAAW, Abridged Standard Atomic Weights 2024 (ciaaw.org), read 11 November 2026.

The build has not run this example through the tool.

Worked by an AI session on 2026-11-25. No person has yet worked this case.

## Sources

1. Goldberg RN, Kishore N, Lennen RM. Thermodynamic quantities for the ionization reactions of buffers. J Phys Chem Ref Data 2002;31:231-370. Used for: pK at the working temperature. At: equation 12, p. 233; section 8 (pp. 359-360). **Read in full, 11 November 2026**
2. IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW). Abridged Standard Atomic Weights 2024. Used for: Formula weight from the molecular formula. At: table Abridged Standard Atomic Weights 2024, section column "Abridged Standard Atomic Weight". **Read in full, 11 November 2026**

**Cited, not read**

3. Prohaska T, Irrgeher J, Benefield J, et al. Standard atomic weights of the elements 2021 (IUPAC Technical Report). Pure Appl Chem 2022;94:573-600. Used for: Formula weight from the molecular formula. The publisher's site (degruyter.com) answered 202 with an empty body to a plain request on 11 November 2026; the session does not work round a bot check. Listed for a person to read. **Not read**

Read by AI-assisted sessions. No person has checked these readings.

## How it is checked

**Level:** Checked against a reference, the lowest of its 3 methods.

**Checked against:** Buffer mass of the exact chemical form and the pH-meter setpoint at the preparation temperature: A CIAAW 2021 sum in Python's decimal module and Goldberg's equation 12 in NumPy 2.5.3 on 18 cases, 8 of them refusals: mass to nine significant figures, setpoint within 0.01 pH (10 October 2026). The 17 buffers 1.2.0 adds are checked in Python decimal on 36 cases, 23 of them refused, and their pK at three temperatures, from a third transcription of the paper's table; 21 October 2026. pK at the working temperature: Goldberg's equation 12 in NumPy 2.4.6 within 0.01 on 15 buffers at 4, 25 and 37 °C (6 October 2026), and all 34 buffers in exact decimal arithmetic (Python decimal, 50 digits) from a third transcription of the paper's table, within 1e-9 at 4, 25 and 37 °C and the range's ends, every constant equal to the transcription; 21 October 2026. Formula weight from the molecular formula: A CIAAW 2021 sum in Python's decimal module, with the formula from RDKit 2026.03.6, exactly on 58 fixtures (6 October 2026). The refusals and the decimal-dot warning added in 1.2.0 are unit-tested, not checked against an independent reader (10 November 2026).

**Cases:** Buffer mass of the exact chemical form and the pH-meter setpoint at the preparation temperature: No case set is linked to this version. pK at the working temperature: 34 on record; not printed here. Formula weight from the molecular formula: No case set is linked to this version.

**Hostile inputs:** Sent 103 malformed, extreme and misspelt calls. None broke it, and every call with an undeclared argument, or with text in place of a number or a true/false value, was declined with a reason. Run 2026-11-12-2 of 12 November 2026, server 0.11.0.

**Same answer:** Called twice and with its arguments in another order, it gave the same result; rewriting its quantities in other units changed no number (5 rewrites). Run 2026-11-12-2 of 12 November 2026, server 0.11.0.

**Not checked:** Buffer mass of the exact chemical form and the pH-meter setpoint at the preparation temperature: The setpoint rests on the fixed-ratio assumption, which no measured data set here tests: no pH-meter reading at either temperature is among the cases. Ionic strength is not applied: the thermodynamic pK differs from the working pK of a real buffer. pK at the working temperature: All 34 table entries were compared with section 8 of the NIST copy on 11 November 2026 and agree. The paper marks some ΔrCp° values as approximate (≈), for example borate (≈−240) and the pK2 of maleate (≈−31); the table carries them as plain numbers and the reply does not say they are approximate. Formula weight from the molecular formula: No published case set names formula-mass\@1.3.0. The 58 cases of stored reference values (lab-calculators 0.1.0 and 0.2.0) name no method version, and stored reference values (0.11.0) is for formula-mass\@1.1.0; neither is tied to this version yet.

No independent scientist has yet reviewed this.

### What was not checked, in full

from the method records

[Buffer mass of the exact chemical form and the pH-meter setpoint at the preparation temperature](https://www.drybench.com/methods/m/buffer-recipe/1.2.2)

- The setpoint rests on the fixed-ratio assumption, which no measured data set here tests: no pH-meter reading at either temperature is among the cases.
- Ionic strength is not applied: the thermodynamic pK differs from the working pK of a real buffer.
- No published case set names buffer-recipe\@1.2.0 by exact key.

[pK at the working temperature](https://www.drybench.com/methods/m/pka-temperature-goldberg/1.1.0)

- All 34 table entries were compared with section 8 of the NIST copy on 11 November 2026 and agree.
- The paper marks some ΔrCp° values as approximate (≈), for example borate (≈−240) and the pK2 of maleate (≈−31); the table carries them as plain numbers and the reply does not say they are approximate.
- The paper grades the uncertainty of each ΔrH° (classes A to D); the grades are not carried, so no uncertainty on pK(T) is given.
- No published case set names pka-temperature-goldberg\@1.1.0 by exact key.

[Formula weight from the molecular formula](https://www.drybench.com/methods/m/formula-mass/1.3.0)

- No published case set names formula-mass\@1.3.0.
- The 58 cases of stored reference values (lab-calculators 0.1.0 and 0.2.0) name no method version, and stored reference values (0.11.0) is for formula-mass\@1.1.0; neither is tied to this version yet.
- The change notes for 1.2.0 and 1.3.0 say every published mass is unchanged (none of those formulas starts with a digit); tying the sets needs a re-run tool-case file under this project's ruling of 11 November 2026, section S6.
- The 1.3.0 refusal of a formula starting with a digit is unit-tested and has two hand cases (13CH4, 2H2O), not a published case set.
- The 58 cases' expected values are CIAAW sums in Python's decimal module over formulas taken from RDKit 2026.03.6: RDKit supplied the formula, not the mass.
- The 1.2.0 refusals and the decimal-dot warning are unit-tested only, not checked against an independent formula reader.
- The IUPAC 2021 report (Prohaska et al.
- 2022) was not read: its publisher's site refused a plain request.
- The table was checked element by element against CIAAW's abridged table page instead, on 11 November 2026: all 84 values agree.
- No case runs this method through the served tool on its production runtime.

### What this project's records still lack

2 things

- A run of the worked example through the tool for all three methods.
- A case set linked to this version for buffer-recipe\@1.2.2 and formula-mass\@1.3.0.

### Cite a number from this tool

the cite line

Every reply carries a cite line naming the tool, the server version, each method with its version and level, and the receipt. Quote it with any number taken from the reply.

```cite
calc_buffer_recipe, server 1.0.0; buffer-recipe@1.2.2 (Checked against a reference); pka-temperature-goldberg@1.1.0 (Checked against a reference); formula-mass@1.3.0 (Checked against a reference); receipt ece051d6baa7/fd90e84a08dc; methods https://www.drybench.com/methods/calculators; page https://www.drybench.com/methods/tools/calc-buffer-recipe. Quote this line with any number taken from this reply.
```

### Changes to its methods

2 changes

- [25 November 2026, buffer-recipe\@1.2.2](https://www.drybench.com/methods/corrections#2026-11-25-buffer-recipe122-1): In 1.2.2, through formula-mass 1.3.0, a weighed form starting with a digit is now refused (problem formula); every other mass is unchanged.
- [25 November 2026, formula-mass\@1.3.0](https://www.drybench.com/methods/corrections#2026-11-25-formula-mass130-1): In 1.3.0 a formula starting with a digit is now refused; every other mass is unchanged. The refusal gives position 0 and both readings: an isotope label is not read, and a count of molecules is not a formula. A multiplier after a middle dot, a period or an asterisk (CuSO4·5H2O, CaCl2·2H2O) is read as before, and every formula 1.2.0 refused keeps its refusal and message.
