Splitting amplitudes are universal functions governing the collinear behavior of scattering amplitudes for massless particles. We compute the two-loop g (yields) gg splitting amplitudes in QCD, N = 1, and N = 4 super-Yang-Mills theories, which describe the limits of two-loop n-point amplitudes where two gluon momenta become parallel. They also represent an ingredient in a direct x-space computation of DGLAP evolution kernels at next-to-next-to-leading order. To obtain the splitting amplitudes, we use the unitarity sewing method. In contrast to the usual light-cone gauge treatment, our calculation does not rely on the principal-value or Mandelstam-Leibbrandt prescriptions, even though the loop integrals contain some of the denominators typically encountered in light-cone gauge. We reduce the integrals to a set of 13 master integrals using integration-by-parts and Lorentz invariance identities. The master integrals are computed with the aid of differential equations in the splitting momentum fraction z. The (epsilon)-poles of the splitting amplitudes are consistent with a formula due to Catani for the infrared singularities of two-loop scattering amplitudes. This consistency essentially provides an inductive proof of Catani's formula, as well as an ansatz for previously-unknown 1/(epsilon) pole terms having non-trivial color structure. Finite terms in the splitting amplitudes determine the collinear behavior of finite remainders in this formula.