Buffer pH Calculator (Henderson–Hasselbalch)
Calculate the pH of a buffer, see how it responds when strong acid or base is added, and find its capacity and effective range. Includes acetate, ammonia, bicarbonate and phosphate presets.
Describe the buffer
Buffer pH as strong base is added
Left of zero is strong acid added, right is strong base. The curve is flat near the middle and rises steeply at the ends as one component runs out.
Show the Larzscript program that just ran
Run a calculation to see the exact program.
This is the real program the page sent to the Larzscript interpreter (compiled to WebAssembly) in your browser. The library it imports is the same code the automated tests check.
The equation
A buffer is a weak acid HA together with its conjugate base A⁻. Adding strong base converts HA to A⁻ (moles of A⁻ increase, HA decrease); adding strong acid does the reverse. After the addition the new moles are put into the same equation: pH = pKa + log₁₀((nA⁻ + nOH⁻) / (nHA − nOH⁻)).
Worked example, computed above
1 L of 0.1 M acetic acid + 0.1 M acetate has pH 4.7600. Adding 10 mmol of NaOH gives 0.11 mol acetate and 0.09 mol acetic acid, pH = 4.76 + log(0.11/0.09) = 4.8472, a change of only 0.087. The buffer holds 100.000 mmol of each component, so it can absorb up to about that much strong acid or base.
What is verified
Henderson–Hasselbalch is checked at known ratios (1 : 1 gives pKa, 10 : 1 gives pKa + 1, 1 : 10 gives pKa − 1) and against explicit mole balances for added acid and base; overwhelming the buffer must raise an error, and mutation tests confirm that swapping the acid and base roles or inverting the ratio is caught.
Limits: ideal solutions (no ionic-strength correction), and the Henderson–Hasselbalch approximation, which is best when both components are above about 0.001 M and the ratio lies between 0.1 and 10. For the exact pH of weak acid + strong base mixtures use the titration curve calculator.
Frequently asked questions
What is the Henderson–Hasselbalch equation?
pH = pKa + log₁₀([A⁻]/[HA]), where [A⁻] is the concentration of the conjugate base and [HA] of the weak acid. Equal amounts give pH = pKa: an acetate buffer with equal parts (pKa 4.76) has pH 4.7600.
How do I make a buffer of a given pH?
Choose an acid whose pKa is within one unit of the target, then set the base : acid ratio to 10^(pH − pKa). For pH 5.76 with acetic acid that is a 10 : 1 ratio — the result above for base 1.0 M / acid 0.1 M is pH 5.7600.
What happens when I add strong acid or base?
The buffer converts it into the other form, so the pH moves only slightly. Adding 10 mmol of NaOH to 1 L of a 0.1 M / 0.1 M acetate buffer changes the pH from 4.7600 to 4.8472. The same 10 mmol added to pure water would change the pH by 5 units.
When does a buffer fail?
When you add more strong base than there is acid (or the reverse), one component is used up and the pH jumps. Adding 200 mmol of base to the buffer above, which holds only 100 mmol of acid, overwhelms it. The calculator reports that instead of returning a number.
What is buffer capacity?
How much strong acid or base a buffer can absorb before failing. It is limited by the smaller of the two components: 0.1 mol of each in a litre can absorb about 0.1 mol of either, and is best (flattest) near pH = pKa, working from about pKa − 1 to pKa + 1.
Does dilution change the pH of a buffer?
In the ideal model no, because only the ratio matters, but the capacity drops in proportion. Real buffers drift slightly because of ionic-strength effects that this calculator ignores.
Every number on this page is computed by the open-source larzscript-chem library (chemistry, physconst, physmath), written in Larzscript, and checked against independent references in its test suite. How it is verified →