In this paper we construct a CHY representation for all tree-level primitive QCD amplitudes. The quarks may be massless or massive. We define a generalised cyclic factorĈ(w, z) and a generalised permutation invariant functionÊ(z, p, ε). The amplitude is then given as a contour integral encircling the solutions of the scattering equations with the productĈÊ as integrand. Equivalently, it is given as a sum over the inequivalent solutions of the scattering equations, where the summand consists of a Jacobian times the productĈÊ. This representation separates information: The generalised cyclic factor does not depend on the helicities of the external particles, the generalised permutation invariant function does not depend on the ordering of the external particles.