Henderson/Hasselbach Derivation">


In a weak acid solution:
Ka = ([H+][A¯])/[HA]

Solve for [H+]:
[H+] = Ka ([HA]/[A¯])

Take the log of both sides:
log ([H+]) = log (Ka) + log ([HA]/[A¯])

Multiply by -1:
-log ([H+]) = -log (Ka) - log ([HA]/[A¯])

And voila!
pH = pKa - log ([HA]/[A¯])