How to Calculate pH: Formulas for Acids, Bases and Buffers

Lab bench with a pH meter reading 4.94 wired to a beaker, a rack of colored test tubes, a pH color chart and a lemon half

To calculate pH, take the negative base-10 logarithm of the hydrogen-ion concentration in moles per liter: pH = −log[H⁺]. A solution with [H⁺] = 0.001 M has a pH of 3. For strong acids, [H⁺] equals the acid concentration; for weak acids, you first solve for [H⁺] using the acid’s Ka.

That formula is short, but the work is in getting [H⁺] right. A strong acid hands you the number directly. A weak acid, a base, a buffer or a very dilute solution each needs one extra step. This guide covers all of them with worked numbers, explains pOH and the water constant Kw, and finishes with a table of everyday pH values so you have a feel for what the numbers mean.

If you want to check an answer quickly, our pH calculator handles strong and weak acids and bases, and includes Ka and Kb values for 40 common compounds.

What pH actually measures

pH is a measure of how acidic or basic a water solution is, set by the concentration of hydrogen ions (strictly, hydronium ions, H₃O⁺). Because those concentrations span an enormous range, from about 1 M in strong acid to 10⁻¹⁴ M in strong base, chemists use a logarithmic scale to squeeze them into numbers between roughly 0 and 14.

Two consequences of the logarithm matter every time you use pH:

  • Each whole step is a factor of ten. A solution at pH 3 has ten times more H⁺ than one at pH 4 and a thousand times more than one at pH 6.
  • Lower pH means more acidic. The minus sign in the formula flips the direction, so a bigger [H⁺] gives a smaller pH.

At 25 °C, pure water has [H⁺] = 1.0 × 10⁻⁷ M, which gives the neutral value of 7. Below 7 is acidic; above 7 is basic (alkaline). The US Geological Survey has a clear overview of pH and water if you want the environmental side.

How to calculate pH for a strong acid

Strong acids such as hydrochloric (HCl), nitric (HNO₃) and perchloric (HClO₄) dissociate completely in water. Every molecule gives up its proton, so [H⁺] equals the acid’s molarity.

Worked example

What is the pH of 0.0025 M HCl?

  1. [H⁺] = 0.0025 M = 2.5 × 10⁻³ M
  2. pH = −log(0.0025) = 2.60

For a quick sanity check, 0.001 M would be pH 3 and 0.01 M would be pH 2, so 0.0025 M should land between them, and it does.

Diprotic strong acids such as sulfuric acid release a second proton less completely, so 0.01 M H₂SO₄ is not exactly pH 1.70 (which assumes 0.02 M H⁺). For classroom problems, check whether the question expects you to count both protons. Not sure of the concentration to begin with? The molarity calculator converts grams and volume into mol/L, and the molarity guide walks through it.

Going the other way: [H⁺] from pH

To recover the concentration, raise 10 to the negative pH: [H⁺] = 10^(−pH). A sample at pH 3.2 has [H⁺] = 10⁻³·² = 6.31 × 10⁻⁴ M. The hydrogen ion concentration calculator does this conversion, and the antilog calculator works for any base-10 power.

Strong bases, pOH and the water constant

Bases are easier to handle through hydroxide ions. Define pOH the same way: pOH = −log[OH⁻]. In any water solution at 25 °C,

  • [H⁺] × [OH⁻] = Kw = 1.0 × 10⁻¹⁴
  • pH + pOH = 14.00

Worked example

What is the pH of 0.050 M NaOH?

  1. NaOH is a strong base, so [OH⁻] = 0.050 M.
  2. pOH = −log(0.050) = 1.30
  3. pH = 14.00 − 1.30 = 12.70

For Ca(OH)₂ or Ba(OH)₂, multiply the concentration by two before taking the log, because each formula unit releases two hydroxide ions.

How to calculate pH of a weak acid

Weak acids such as acetic acid (vinegar), citric acid and carbonic acid dissociate only partly. The acid dissociation constant Ka tells you how far:

Ka = [H⁺][A⁻] ÷ [HA]

If the starting concentration is c and x mol/L dissociates, then [H⁺] = [A⁻] = x and [HA] = c − x, so Ka = x² ÷ (c − x).

Worked example: 0.10 M acetic acid

Acetic acid has Ka = 1.75 × 10⁻⁵ (pKa 4.76).

  1. Approximation. Because Ka is small, assume x is tiny compared with c, so Ka ≈ x² ÷ c. Then x = √(1.75 × 10⁻⁵ × 0.10) = 1.32 × 10⁻³ M.
  2. pH = −log(1.32 × 10⁻³) = 2.88.
  3. Check the assumption. 1.32 × 10⁻³ ÷ 0.10 = 1.3%, well under the usual 5% limit, so the shortcut is fine. Solving the full quadratic gives x = 1.31 × 10⁻³ M and the same pH of 2.88.

Notice how different this is from a strong acid. 0.10 M HCl has a pH of 1.00; the same concentration of acetic acid sits at 2.88, because only about 1 in 76 molecules has given up its proton. If the 5% check fails, typically with a larger Ka or a very dilute solution, use the quadratic formula. Ka values are often listed as pKa (pKa = −log Ka), and the pKa calculator converts between the two.

Weak bases

Weak bases work the same way with Kb. For 0.10 M ammonia (Kb = 1.8 × 10⁻⁵), [OH⁻] = √(1.8 × 10⁻⁶) = 1.34 × 10⁻³ M, so pOH = 2.87 and pH = 11.13.

Buffers and the Henderson–Hasselbalch equation

A buffer is a mix of a weak acid and its conjugate base (or a weak base and its conjugate acid). It resists pH changes when you add small amounts of acid or base, which is why blood, cell culture media and many lab procedures depend on one. For a buffer, the quickest route is the Henderson–Hasselbalch equation:

pH = pKa + log([A⁻] ÷ [HA])

Worked example

A buffer contains 0.10 M acetic acid and 0.15 M sodium acetate. With pKa = 4.76:

  1. Ratio [A⁻] ÷ [HA] = 0.15 ÷ 0.10 = 1.5
  2. log(1.5) = 0.176
  3. pH = 4.76 + 0.18 = 4.94

Two useful patterns fall out of the equation. When the acid and base concentrations are equal, the log term is zero and pH = pKa. And a buffer works best within about one pH unit of its pKa, where the ratio stays between 1:10 and 10:1. The Henderson–Hasselbalch calculator solves for any unknown, including the ratio you need for a target pH, and the buffer pH calculator shows how the pH shifts when you add strong acid or base.

Everyday pH values

SubstanceTypical pH[H⁺] (mol/L)
Battery acid0 to 11 to 0.1
Stomach acid1.5 to 3.5about 10⁻²
Lemon juiceabout 210⁻²
Vinegarabout 2.5 to 3about 10⁻³
Black coffeeabout 510⁻⁵
Pure water (25 °C)7.010⁻⁷
Human blood7.35 to 7.45about 4 × 10⁻⁸
Seawaterabout 8.1about 8 × 10⁻⁹
Baking soda solutionabout 8.3about 5 × 10⁻⁹
Household ammonia11 to 1210⁻¹¹ to 10⁻¹²
Bleach12.5 to 13about 10⁻¹³

For drinking water, the EPA lists a secondary standard of pH 6.5 to 8.5. Water outside that range is not necessarily unsafe, but it tends to taste bitter or metallic and can corrode pipes or leave scale.

Temperature, dilution and other edge cases

Neutral is not always 7

Kw rises with temperature. At 37 °C (body temperature) Kw is about 2.4 × 10⁻¹⁴, so neutral water has a pH of about 6.81. It is not acidic; [H⁺] still equals [OH⁻]. The value 14 for pH + pOH applies at 25 °C only.

Very dilute acids

Plugging 1.0 × 10⁻⁸ M HCl into −log gives pH 8, which would make an acid basic. That is wrong because water itself contributes 10⁻⁷ M of H⁺, ten times more than the acid. Solving with the water equilibrium included gives [H⁺] = 1.05 × 10⁻⁷ M and a pH of 6.98, just barely acidic. Once an acid falls below about 10⁻⁶ M, account for water.

Dilution

Diluting a strong acid tenfold raises its pH by one unit: 0.01 M HCl (pH 2) diluted to 0.001 M becomes pH 3. A weak acid moves by less, only about half a unit per tenfold dilution, because more of it dissociates as it gets more dilute. The dilution calculator (C₁V₁ = C₂V₂) gives the new concentration to feed into the pH formula.

Common mistakes

  • Forgetting the minus sign. log(0.001) is −3; pH is +3.
  • Treating a weak acid as strong. 0.10 M acetic acid is pH 2.88, not 1.00.
  • Using natural log. pH uses base-10 logs. On a calculator that is “log”, not “ln”.
  • Ignoring stoichiometry. Ba(OH)₂ gives two OH⁻ per formula unit.
  • Applying pH + pOH = 14 at other temperatures. It holds at 25 °C.
  • Reporting too many decimals. The number of decimal places in pH should match the significant figures in [H⁺]: 2.5 × 10⁻³ M gives pH 2.60, not 2.602. For more on reporting measured values, see percent error vs percent difference.

Frequently asked questions

What is the formula for pH?

pH = −log₁₀[H⁺], where [H⁺] is the hydrogen-ion concentration in mol/L. For bases, calculate pOH = −log₁₀[OH⁻] and use pH = 14 − pOH at 25 °C.

Can pH be negative or above 14?

Yes. Concentrated strong acids above 1 M have a negative pH, and concentrated strong bases can exceed 14. The 0 to 14 range covers most dilute solutions, not all.

How do I calculate pH from pKa?

For a buffer, use pH = pKa + log([A⁻] ÷ [HA]). For a weak acid alone, convert pKa to Ka with Ka = 10^(−pKa), then solve Ka = x² ÷ (c − x) for [H⁺].

Why is pH logarithmic?

Hydrogen-ion concentrations span more than 14 orders of magnitude. A log scale turns that range into small, easy-to-compare numbers.

How accurate are pH strips compared with a pH meter?

Universal indicator strips usually read to about one pH unit; narrow-range strips to about 0.5. A calibrated pH meter reads to 0.01 and is the right tool for lab work.

Every pH problem comes down to finding [H⁺] and taking its negative log. Strong acids and bases give you the concentration directly, weak ones need Ka or Kb, and buffers use Henderson–Hasselbalch. Keep the factor-of-ten meaning of each step in mind and the numbers will start to feel intuitive.