pH
Chemistry

pH calculator

Compute pH from H+ concentration - strong-acid and weak-acid modes.

01Inputs
02Results
pH
pOH
H+ activity
OH− activity
pH scale 0 → 14 — acidic | neutral | basic

pH = −log₁₀[H+]. Strong acid mode assumes complete dissociation. Weak-acid mode uses pH ≈ ½(pKa − log C), valid when C ≫ Ka (typical 0.01–1 mol/L). The scale shows the standard acid → base color gradient.

03How it works

Why this calculation

pH is the most-used quantity in chemistry, biology, environmental science, and a dozen industrial settings (water treatment, brewing, pool maintenance, soil testing, food preservation). It quantifies the acidity or basicity of an aqueous solution on a logarithmic scale 0–14, where 7 is neutral. A change of 1 pH unit is a 10× change in hydrogen-ion activity — moving from pH 5 to pH 4 tenfolds the acidity. People consistently underestimate this: rainwater at pH 5.6 (mildly acidic from dissolved CO₂) is 100× more acidic than pure water at pH 7, and acid rain at pH 4 is 1 000× more acidic. This calculator handles the four common entry points: forward and reverse conversion between pH and [H⁺], plus pH from a known acid concentration in either strong-acid (full dissociation) or weak-acid (Ka-based equilibrium) mode.

The formula

The base equation: pH = −log₁₀[H⁺], where [H⁺] is the activity of hydrogen ions in mol/L.

Strong acid mode: assumes 100 % dissociation. [H⁺] = C₀ (concentration). pH = −log₁₀(C₀). Examples: HCl, HNO₃, H₂SO₄ (first proton).

Weak acid mode (when C ≫ Ka): pH ≈ ½(pKa − log C), where pKa = −log₁₀(Ka). This approximation drops the equilibrium quadratic when the dissociated fraction is small. For more dilute weak acids (C ≈ Ka), the full quadratic [H⁺]² + Ka[H⁺] − Ka·C = 0 is required; the approximation here introduces 5–15 % error in such cases.

[H⁺] → pH: pH = −log₁₀(input).

pH → [H⁺]: [H⁺] = 10^(−pH).

Auxiliary outputs: pOH = 14 − pH (water self-ionization at 25 °C, K_w = 10⁻¹⁴). [OH⁻] = 10^(−pOH).

Classification: pH < 3 strongly acidic; 3–6 acidic; 6–7.5 near-neutral; 7.5–10 basic; > 10 strongly basic.

How to use

Pick the mode: - Strong acid concentration — enter the molar concentration C₀ of the acid (e.g. 0.01 mol/L for 0.01 M HCl). - Weak acid (Ka + concentration) — enter both the dissociation constant Ka (e.g. 1.8e-5 for acetic acid) and the concentration. - From [H⁺] to pH — enter the H⁺ activity in mol/L. - From pH to [H⁺] — enter the pH (0–14).

The result panel shows pH (headline), classification, pOH, [H⁺] and [OH⁻] activities, plus a 14-segment color-graded pH scale with a marker at the computed value (red on the acidic end, purple on the basic end, classic litmus-paper aesthetic).

Worked example

0.01 mol/L HCl (strong acid, full dissociation).

  • [H⁺] = 0.01 mol/L = 10⁻² mol/L.
  • pH = −log(0.01) = 2.0.
  • pOH = 12. [OH⁻] = 10⁻¹² mol/L.
  • Classification: Strongly acidic.

0.1 mol/L acetic acid (weak acid, Ka = 1.8 × 10⁻⁵).

  • pKa = −log(1.8e-5) = 4.74.
  • pH ≈ 0.5 × (4.74 − log(0.1)) = 0.5 × (4.74 + 1) = 0.5 × 5.74 = 2.87.
  • Compare with full quadratic: pH ≈ 2.88 (negligible difference; approximation valid).

Sea water (typical pH 8.1).

  • [H⁺] = 10⁻⁸·¹ = 7.94 × 10⁻⁹ mol/L.
  • pOH = 5.9; [OH⁻] = 1.26 × 10⁻⁶ mol/L.
  • Classification: Basic (slightly).

Pitfalls

Activity vs concentration. At high ionic strength (sea water, gastric acid, concentrated electrolytes), the activity of H⁺ differs from its molar concentration by an activity coefficient < 1. pH is technically defined on activity, not concentration. The calc treats them as equal (valid for dilute solutions, < 0.01 M); at higher concentrations introduce a 0.05–0.3 unit correction.

Temperature dependence of K_w. The 14 = pH + pOH identity holds at 25 °C. At 37 °C (body temperature), K_w shifts and pH-of-neutral becomes ~6.8. At 0 °C it's ~7.5. The calc uses 25 °C; for biological pH (blood, 7.4 at 37 °C) use the 37 °C K_w.

Diluted weak acid breaks the approximation. At C ≈ Ka, the ½(pKa − log C) formula under-estimates the actual pH because the dissociated fraction is no longer negligible. For C/Ka < 100, solve the quadratic explicitly.

Polyprotic acids. H₂SO₄, H₃PO₄, citric acid, etc., have multiple Ka values (Ka₁, Ka₂, Ka₃). The calc treats only the first dissociation. For H₂SO₄ (Ka₁ very large, Ka₂ = 0.01), the second ionization matters at low concentrations.

Buffers. Mixing a weak acid with its conjugate base creates a buffer (Henderson-Hasselbalch: pH = pKa + log([A⁻]/[HA])). The calc does not handle buffer mixtures.

pH probe drift. Real-world pH measurement uses a glass electrode that drifts (calibration matters), is sensitive to temperature, and has a ±0.05 unit accuracy on a good day. Lab pH meters are calibrated at pH 4.01, 7.00, 10.01 buffers daily.

Hydrolysis of salts. NaCl in water gives pH ≈ 7 (no hydrolysis). NH₄Cl gives slightly acidic. CH₃COONa gives slightly basic. The calc doesn't compute these — they require Ka/Kb of the parent acid/base.

Activity of water = 1. The calc implicitly assumes pure water as solvent. In non-aqueous solvents (alcohols, DMSO) pH is not well-defined and the K_w identity doesn't hold.

Negative pH. Concentrated acids (12 M HCl) have pH < 0. The calc allows it; the scale visualization clamps at 0.

Logarithm precision. JS Math.log10 gives ~15 significant digits, far more than any pH meter; the limit is the input.

Variations

  • pKa table lookup: a static table for common acids (acetic 4.76, formic 3.75, citric 3.13, etc.).
  • Henderson-Hasselbalch buffer calc: pH from a weak-acid + conjugate-base mixture.
  • Polyprotic acid distribution: alpha-fractions vs pH for H₂CO₃, H₃PO₄, etc.
  • Titration curve plotter: simulated titration of a weak acid with strong base.
  • Conductivity to ion strength: another approach to ionic activity.

Related calculators