The gradient-flow formulation of the energy-momentum tensor of QCD is extended to NNLO perturbation theory. This means that the Wilson coefficients which multiply the flowed operators in the corresponding expression for the regular energy-momentum tensor are calculated to this order. The result has been obtained by applying modern tools of regular perturbation theory, reducing the occurring two-loop integrals, which also include flow-time integrations, to a small set of master integrals which can be calculated analytically.