Acid-Base Indicators: Calculating the transition point

Since the indicator is a weak acid, with a Brönsted-Lowry equation of: HIn + H2 H3O+  + In- it will have an acid equilibrium constant (not including the liquid H2O) of 

If we assume that the change between the two colored forms occurs when we have equal amounts of each, then the transition point is when [HIn] = [In-].  Because they are equal we can cancel them from the equation.  Therefore, 

In other words, at the transition point, the Ka  for the indicator equals the [H3O+] of the solution we are titrating.
Taking the negative logarithm of each side, this can be written as pKa = pH.

This means that the best indicator, in terms of the range of its color change range is the one in which the pKa for the indicator equals the pH of the equivalence point.  Other factors, such as ease of detection of the color (phenolpthalein is very easy to see) may also influence the choice of an indicator.