We determine from first principles the quark mass anomalous dimension in Nf=3 QCD between the electroweak and hadronic scales. This allows for a fully non-perturbative connection of the perturbative and non-perturbative regimes of the Standard Model in the hadronic sector. The computation is carried out to high accuracy, employing massless O(a)-improved Wilson quarks and finite-size scaling techniques. We also provide the matching factors required in the renormalisation of light quark masses from lattice computations with O(a)-improved Wilson fermions and a tree-level Symanzik improved gauge action. The total uncertainty due to renormalisation and running in the determination of light quark masses in the SM is thus reduced to about 1%.