  The soft theorem states that scattering amplitude in gauge theory with a soft
gauge-boson emission can be factorized into a hard scattering amplitude and a
soft factor. In this paper, we present calculations of the soft factor for
processes involving two hard colored partons, up to three loops in QCD. To
accomplish this, we developed a systematic method for recursively calculating
relevant Feynman integrals using the Feynman-Parameter representation. Our
results constitute an important ingredient for the subtraction of infrared
singularities at N$^4$LO in perturbative QCD. Using the principle of leading
transcendentality between QCD and ${\cal N}=4$ super Yang-Mills theory, we
determine the soft factor in the latter case to three loops with full-color
dependence. As a by-product, we also obtain the finite constant $f_2^{(3)}$ in
the Bern-Dixon-Smirnov ansatz analytically, which was previously known
numerically only.
