The gradient-flow formalism proves to be a useful tool in lattice calculations of quantum chromodynamics. For example, it can be used as a scheme to renormalize composite operators by inverting the short-flow-time expansion of the corresponding flowed operators. In this paper, we consider the short-flow-time expansion of five quark bilinear operators, the scalar, pseudoscalar, vector, axialvector, and tensor currents, and compute the matching coefficients through next-to-next-to-leading order QCD. Among other applications, our results constitute one ingredient for calculating bag parameters of mesons within the gradient-flow formalism on the lattice.