The QCD/HQET matching coefficient for the heavy-quark field is calculated up to four loops. It must be finite; this requirement produces analytical results for some terms in the four-loop on-shell heavy-quark field renormalization constant which were previously only known numerically. The effect of a nonzero lighter-flavor mass is calculated up to three loops. A class of on-shell integrals with two masses is analyzed in detail. By specifying our result to QED, we obtain the relation between the electron field and the Bloch–Nordsieck field with four-loop accuracy.