pH calculator for strong/weak acids, bases, and buffers

pH is defined as pH = −log₁₀ a(H⁺). In the dilute aqueous problems you see in general chemistry, we replace activity with molarity and write pH = −log₁₀[H⁺]. One pH unit is a tenfold change in [H⁺], so small mistakes in concentration show up loudly on the log scale.
Pick the right model before you punch numbers. Strong acids/bases: assume complete dissociation, then (for very dilute solutions) remember water still contributes H⁺ and OH⁻. Weak acids need Ka; weak bases need Kb. Ammonia is the classic weak-base example—course tables almost always list Kb(NH₃) ≈ 1.8×10⁻⁵ at 25 °C. A buffer is a weak acid plus its conjugate base; there you reach for Henderson–Hasselbalch, not the single-species weak-acid quadratic.
This calculator handles five classroom modes at 25 °C with Kw = 1.0×10⁻¹⁴: strong acid, strong base, weak acid, weak base, and a simple HA/A⁻ buffer. Presets include acetic acid, ammonia (Kb = 1.8×10⁻⁵), and common buffer sketches. For named buffer recipes in grams, switch to the Phosphate Buffer Calculator; here the job is to get pH and pOH from concentrations and constants.
- Strong electrolyte: start from C, then correct with water if C is tiny (~10⁻⁶ M or less)
- Weak acid/base: solve Ka or Kb = x²/(C − x); x is [H⁺] or [OH⁻]
- Buffer: pH ≈ pKa + log₁₀([A⁻]/[HA])
- Conjugate pair: Ka × Kb = Kw (same T)
Formulas you will actually use
Working relations at 25 °C (Kw = 1.0×10⁻¹⁴):
pH = −log₁₀[H⁺]
pOH = −log₁₀[OH⁻]
pH + pOH = 14
[H⁺][OH⁻] = Kw
Weak acid HA:
Ka = x² / (C − x), x = [H⁺]
Weak base B (e.g. NH₃):
Kb = x² / (C − x), x = [OH⁻]
pH = 14 − pOH
Buffer:
pH = pKa + log₁₀([A⁻]/[HA])
pKa = −log₁₀(Ka)- If a problem hands you Ka for NH₄⁺, convert with Kb(NH₃) = Kw/Ka.
- Textbook Kb(NH₃) = 1.8×10⁻⁵ is the usual 25 °C homework value—not a high-precision metrology constant.
- Polyprotic stepwise equilibria and activity corrections are outside this tool.
Step-by-step example: 0.10 M ammonia, Kb = 1.8×10⁻⁵
Find the pH of 0.10 M NH₃(aq) at 25 °C using Kb = 1.8×10⁻⁵ (the value on most general-chemistry tables).
- Weak base: Kb = x²/(0.10 − x) = 1.8×10⁻⁵, with x = [OH⁻].
- Quadratic: x = (−Kb + √(Kb² + 4 Kb C))/2 ≈ 1.33×10⁻³ M.
- Shortcut √(Kb C) = √(1.8×10⁻⁶) ≈ 1.34×10⁻³ M—close, since x/C ≈ 1.3%.
- pOH = −log₁₀(1.33×10⁻³) ≈ 2.88; pH = 14 − 2.88 ≈ 11.12.
Open the pH Calculator, choose Weak base (or the ammonia preset), C = 0.10, Kb = 1.8e-5. Expect pH near 11.12.
Step-by-step example: 0.10 M acetic acid (same Ka magnitude)
Ka(CH₃COOH) = 1.8×10⁻⁵. Find the pH of 0.10 M acetic acid.
- Ka = x²/(0.10 − x) = 1.8×10⁻⁵ → x = [H⁺] ≈ 1.33×10⁻³ M.
- pH = −log₁₀(1.33×10⁻³) ≈ 2.88.
- Notice the arithmetic mirrors the ammonia case: same C and same 1.8×10⁻⁵ constant, but acid → pH ≈ 2.88 while base → pH ≈ 11.12.
Weak acid mode, 0.10 M, Ka = 1.8e-5. You should see pH ≈ 2.88.
Step-by-step example: Why 1.0×10⁻⁸ M HCl is not pH 8
Someone writes pH = −log(1.0×10⁻⁸) = 8 for extremely dilute HCl. Why is that wrong?
- Pure water already has [H⁺] ≈ 1.0×10⁻⁷ M from Kw.
- Adding 1.0×10⁻⁸ M HCl cannot make the solution basic.
- Charge balance (strong acid + water) gives pH slightly below 7, not 8.
Strong acid mode with concentration 1e-8. The calculator’s water-aware result sits just under 7.
Frequently asked questions
What is the pH formula?
In dilute aqueous solution, pH = −log₁₀[H⁺] (more strictly −log₁₀ of H⁺ activity). Then pOH = −log₁₀[OH⁻] and pH + pOH = 14 at 25 °C. This pH calculator applies that formula after it has [H⁺] from the strong/weak/buffer model you choose.
How do I calculate pH from Ka?
For a monoprotic weak acid HA, Ka = x²/(C − x) with x = [H⁺]. Solve the quadratic (or the √(Ka C) shortcut if x ≪ C), then pH = −log₁₀(x). Choose Weak acid mode, enter concentration and Ka, and read pH. Polyprotic acids such as citric acid need stepwise Ka values; this tool is the monoprotic classroom model.
What Kb should I use for ammonia?
General chemistry homework almost always uses Kb(NH₃) = 1.8×10⁻⁵ at 25 °C. Equivalently, Ka(NH₄⁺) ≈ 5.6×10⁻¹⁰ and Kb = Kw/Ka. Real tabulated values vary slightly with ionic strength and temperature; for exams, use the constant your instructor or table gives.
How do I use the Henderson–Hasselbalch equation?
For a conjugate pair: pH = pKa + log₁₀([A⁻]/[HA]). Equal concentrations → pH = pKa. The calculator also runs a charge-balance check so you can see when the approximation is excellent versus merely “close enough.”
Strong vs weak—how do I choose the mode?
HCl, HNO₃, strong H₂SO₄ (first proton), NaOH, KOH → strong modes. Acetic acid, HF, NH₃ → weak modes with Ka or Kb. If both HA and A⁻ are present in comparable amounts, that is a buffer, not a pure weak-acid problem.
When does Henderson–Hasselbalch break down?
When [HA] or [A⁻] is tiny compared with [H⁺] or [OH⁻], or when you are far outside the pKa ± 1 window. Then solve the full charge-balance problem (or use the calculator’s exact buffer path) instead of trusting the log ratio alone.
Ka and Kb for a conjugate pair?
At the same temperature, Ka × Kb = Kw. Acetic acid Ka = 1.8×10⁻⁵ implies acetate Kb = Kw/Ka ≈ 5.6×10⁻¹⁰. Ammonia Kb = 1.8×10⁻⁵ implies ammonium Ka ≈ 5.6×10⁻¹⁰.
References & further reading
Standards bodies, university open courseware, and peer-reviewed references that align with the methods used on this page.
See also: Phosphate Buffer Calculator · Chemical Equilibrium Calculator · Dilution Calculator
Keep learning with more calculators and study guides on Online Science Tools.