  In this paper we compute the relation between heavy quark masses defined in
the modified minimal subtraction and on-shell scheme. Detailed results are
presented for all coefficients of the SU$(N_c)$ colour factors. The reduction
of the four-loop on-shell integrals is performed for a general QCD gauge
parameter. Some of the about 380 master integrals are computed analytically,
others with high numerical precision based on Mellin-Barnes representations,
and the rest numerically with the help of {\tt FIESTA}. We discuss in detail
the precise numerical evaluation of the four-loop master integrals. Updated
relations between various short-distance masses and the $\overline{\rm MS}$
quark mass to next-to-next-to-next-to-leading order accuracy are provided for
the charm, bottom and top quark. We discuss the dependence on the
renormalization and factorization scale.
