We present the analytic form of the two-loop five-gluon scattering amplitudes in QCD for a complete set of independent helicity configurations of external gluons. These include the first analytic results for five-point two-loop amplitudes relevant for the computation of next-to-next-to-leading-order QCD corrections at hadron colliders. The results were obtained by reconstructing analytic expressions from numerical evaluations. The complexity of the computation is reduced by exploiting physical and analytical properties of the amplitudes, employing a minimal basis of so-called pentagon functions that have recently been classified.