We describe a calculation of the on-shell renormalization factors in QCD
and QED at the three loop level. Explicit results for the fermion mass
renormalization factor Zm and the on-shell fermion wave function
renormalization constant Z2 are given. We find that at O(alpha_s^3) the
wave function renormalization constant Z2 in QCD becomes gauge dependent
also in the on-shell scheme, thereby disproving the ``gauge-independence''
conjecture based on an earlier two-loop result. As a byproduct, we derive
an O(alpha_s^3) contribution to the anomalous dimension of the heavy quark
field in HQET.