The Henderson–Hasselbalch equation mathematically connects the measurable pH of a solution with the pK_{a }(-log K_{a}) of the acid.
The equation is also useful for estimating the pH of a buffer solution and finding the equilibrium pH in an acid-base reaction.
The equation can be derived from the formula of pK_{a} for a weak acid or buffer.
The balanced equation for an acid dissociation is:

The acid dissociation constant is:

After taking the log of the entire equation and rearranging it, the result is:

This equation can be rewritten as:

Distributing the negative sign gives the final version of the Henderson-Hasselbalch equation:

In an alternate application, the equation can be used to determine the amount of acid and conjugate base needed to make a buffer of a certain pH.
With a given pH and known pK_{a}, the solution of the Henderson-Hasselbalch equation gives the logarithm of a ratio which can be solved by performing the antilogarithm of pH/pKa:

An example of how to use the Henderson-Hasselbalch equation to solve for the pH of a buffer solution is as follows:

What is the pH of a buffer solution consisting of 0.0350 M NH_{3} and 0.0500 M NH_{4}^{+ }(K_{a} for NH_{4}^{+} is 5.6 x 10^{-10})?
The equation for the reaction is:

Assuming that the change (x) is negligible, the Henderson-Hasselbalch equation will be:

pH = 9.41