The acid-base equilibria of a diprotic, slightly hydrosoluble base ketoconazole were studied in homogeneous and heterogeneous water systems. The determinations were performed at 25?C at a constant ionic strength of M(NaCl). The acidity constant Ka1 was determined by potentiometric (pKa1 3.20) and spectrophotometric (pKa1 3.26) methods. A pKa2 constant of 6.10 was obtained based on the equilibrium constants pKs0 4.84 and pKs1 -1.26, determined in a heterogeneous ketoconazole system. The obtained values of the constants served to calculate the solubility and the distribution of the equilibrium forms of ketoconazole as a function of pH. On the basis of the distribution of the equilibrium forms of ketoconazole, a spectrophotometric method for the determination of its content in commercial tablets was developed. The determinations were performed at 225 nm in 0.1 M HCl. The method is simple and rapid and enables the direct spectrophotometric determination of the content of ketoconazole without previous isolation.