A calculator that shows its working
pH calculator
Pick what you dissolve and how much. The exact pH comes from the charge balance; the textbook shortcut sits beside it, so you can see when it lies.
To calculate the pH of a solution, find its hydrogen-ion concentration [H⁺] in moles per liter and take pH = −log10[H⁺]. For 0.1 M hydrochloric acid that is immediate: [H⁺] = 0.1 M, pH 1.00. For everything else, [H⁺] is not something you put in the bottle. It is what is left after the acid, the base and water have finished trading protons, and the calculator above finds it exactly by balancing the charges.
Most textbooks give a different shortcut formula for each kind of solution. They are good approximations most of the time, and each fails in a predictable place. This page lists them, shows where each one breaks, and explains the single method that never does. The chapter on the pH scale explains what the number means; this page is about getting it right.
One method for every solution
Every solution in water is electrically neutral: the positive charges add up to the negative ones. That one fact, together with the equilibrium constants, is enough to fix [H⁺]. For a weak acid HA at concentration C, the only ions are H⁺, OH⁻ and A⁻, so
The second form uses two facts from Chapter 2: water’s ion product Kw = [H⁺][OH⁻], and the fraction of the acid that has lost its proton, Ka/(Ka + [H⁺]). Equation (6.1) has one unknown and exactly one positive solution[1]. established A computer finds it by bisection in a few dozen steps: guess a pH, see whether the positive or the negative side of the balance is bigger, and halve the interval. Add sodium ions for a salt, a second acid for a mixture, or more terms for an acid with several protons, and the method does not change. That is what the calculator does, and what every figure on this site does.
The shortcut formulas, and where they fail
The shortcuts come from dropping terms in equation (6.1) that are usually small; analytical chemistry textbooks derive each one this way[4]. Each is safe as long as the term it drops really is small.
| Solution | Shortcut | Dropped | Fails when |
|---|---|---|---|
| Strong acid, C | pH = −log C | water’s own H⁺ | C below about 10⁻⁶ M |
| Strong base, C | pH = pKw + log C | water’s own OH⁻ | C below about 10⁻⁶ M |
| Weak acid | pH = ½(pKa − log C) | the acid used up; water | more than ~5 % dissociated, or pH near 7 |
| Weak base | pOH = ½(pKb − log C) | the base used up; water | the same, mirrored |
| Buffer | pH = pKa + log([A⁻]/[HA]) | exchange with water | dilute, extreme ratio, or pKa near 0 or 14 |
The classic trap is the first row. Dilute hydrochloric acid to 10⁻⁸ M and the formula gives pH 8: an acid that is basic. The exact answer is 6.98, because water’s own 10⁻⁷ M of H⁺ now outweighs the acid’s 10⁻⁸ M[1]. established Type 1e-8 into the calculator with “a strong acid” and watch the two pointers part.
The figure shows why. Each tenfold dilution takes away nine-tenths of the acid’s hydrogen ions, but water keeps supplying its own, about 10⁻⁷ M. Once the acid’s contribution falls to that level the two are comparable, and below it water wins: no amount of dilution can make an acid basic.
The weak-acid shortcut, √(KaC) in disguise, is excellent for 0.1 M acetic acid (2.878 against an exact 2.881) and poor for acids that are either fairly strong or very dilute. At 10⁻⁴ M acetic acid it is off by 0.09, because a third of the acid has dissociated and “x ≪ C” no longer holds. For the hydrogen sulfate ion at 0.01 M it is off by 0.21. For 0.1 M phosphoric acid, whose first pKa is 2.15, it gives 1.57 against an exact 1.63. illustrative The quadratic formula repairs the first failure; only the full balance, with water in it, repairs both.
Worked examples
Each of these is one setting of the calculator. The values are exact solutions of the charge balance at 25 °C, using the thermodynamic pKa values tabulated by Goldberg, Kishore and Lennen[5].
| Solution | Exact pH | Shortcut |
|---|---|---|
| 0.1 M HCl | 1.00 | 1.00 |
| 10⁻⁸ M HCl | 6.98 | 8.00 |
| 0.01 M NaOH | 11.99 | 11.99 |
| 0.1 M acetic acid | 2.88 | 2.88 |
| 10⁻⁴ M acetic acid | 4.47 | 4.38 |
| 0.1 M sodium acetate | 8.88 | 8.88 |
| 0.1 M ammonia | 11.12 | 11.12 |
| 0.1 M ammonium chloride | 5.12 | 5.12 |
| 0.1 M phosphoric acid | 1.63 | 1.57 |
| 0.01 M sodium hydrogen sulfate | 2.21 | 1.99 |
The pattern is worth remembering. The shortcuts are reliable for ordinary concentrations of genuinely weak acids and bases, and for strong ones above about a micromolar. They fail for acids with a pKa near or below 2, which are too strong for “barely dissociated” to hold, and for anything so dilute that water’s own ions compete. For buffers, the map in Chapter 4 shows the same boundary for the Henderson–Hasselbalch equation, and the calculator’s buffer setting lets you test any mixture against it.
What the buffer capacity readout means
Below the ruler the calculator also reports β, the solution’s buffer capacity: how many moles of strong base per liter it would take to raise the pH by one unit, at this pH. Pure water at pH 7 has a β of about 5 × 10⁻⁷ M per pH, which is why one drop of acid moves it so far. A 0.1 M acetate buffer at its pKa has 0.058, more than a hundred thousand times as much. Two solutions with the same pH can differ enormously in how hard they are to move, and β is the number that says so.