Understanding the pH calculator — concept and principle
pH expresses how acidic or basic an aqueous solution is, on a logarithmic scale where 7 is neutral at 25 °C. This calculator finds the pH, pOH and hydrogen-ion concentration of a solution of a single strong acid, strong base, weak acid (from its pKa) or weak base (from its pKb). It is used in chemistry courses, lab preparation and water-treatment checks.
How it is calculated
- pH = −log₁₀[H⁺] and pOH = 14 − pH (Kw = 10⁻¹⁴ at 25 °C).
- Strong acid: [H⁺] = C, so pH = −log₁₀ C.
- Strong base: [OH⁻] = C, so pH = 14 + log₁₀ C.
- Weak acid: K = 10^(−pKa). With x = [H⁺], the equilibrium K = x² ÷ (C − x) becomes x² + Kx − KC = 0, solved exactly: x = (−K + √(K² + 4KC)) ÷ 2.
- Weak base: the same equation with K = 10^(−pKb) gives x = [OH⁻], and pH = 14 + log₁₀ x.
C is in mol/L.
The principle
Strong acids and bases dissociate essentially completely, so the ion concentration equals the formal concentration. A weak acid HA only partly dissociates: HA ⇌ H⁺ + A⁻. If x mol/L dissociate, then [H⁺] = [A⁻] = x and [HA] = C − x, and Ka links them. The common shortcut x ≈ √(KaC) assumes x is negligible beside C; the calculator instead solves the full charge balance, including the H⁺ and OH⁻ that water itself supplies (Kw), so it stays accurate for stronger weak acids and for very dilute solutions: 10⁻⁸ M HCl comes out at pH 6.98, not 8. The logarithm compresses the huge range of [H⁺] into a convenient scale: each pH unit is a tenfold change.
Worked example
Defaults: weak acid, C = 0.1 mol/L, pKa = 4.76 (acetic acid).
- K = 10^(−4.76) = 1.7378 × 10⁻⁵.
- x = (−1.7378 × 10⁻⁵ + √((1.7378 × 10⁻⁵)² + 4 × 1.7378 × 10⁻⁵ × 0.1)) ÷ 2 = 0.0013095964 mol/L.
- pH = −log₁₀(0.0013095964) = 2.882862536.
- pOH = 14 − 2.882862536 = 11.11713746.
| pKa / pKb | pH |
|---|---|
| 1.19 | 1.265100894 |
| 2.38 | 1.734259126 |
| 3.57 | 2.296264337 |
| 4.76 | 2.882862536 |
| 5.95 | 3.475727348 |
| 7.14 | 4.070184522 |
| 9.52 | 5.259940035 |
How to read the result
Below 7 is acidic, above 7 is basic. Here only about 1.3% of the acetic acid is dissociated (0.00131 ÷ 0.1), which is why its pH is near 2.9 instead of 1.0 for 0.1 M HCl. The shortcut √(KaC) would give pH 2.880, very close in this case.
Common mistakes
- Entering pKb for a weak acid, or converting with pKa + pKb = 14 in the wrong direction.
- Treating a diprotic acid like H₂SO₄ as giving only one H⁺ per molecule, or vice versa.
- Applying 14 for Kw at temperatures far from 25 °C.
- Expecting pH 8 for 10⁻⁸ M HCl; very dilute acids are dominated by water's own ions.
Frequently asked questions
What is the pH of 0.1 M HCl?
Exactly 1 by this model, because HCl dissociates completely.
How do I get pKb from pKa?
For a conjugate pair at 25 °C, pKb = 14 − pKa.
Can pH be negative?
Yes, for very concentrated strong acids, though activity effects then make the simple formula unreliable.
Sources: IUPAC Compendium of Chemical Terminology (Gold Book), "pH" · Harris, D. C., Quantitative Chemical Analysis, W. H. Freeman