We consider the Z Q Qbar vertex to second order in the QCD coupling for an on-shell massive quark-antiquark pair and for arbitrary momentum transfer of the Z boson. We present closed analytic expressions for the two parity-violating form factors of that vertex at the two-loop level in QCD, excluding the contributions from triangle diagrams. These form factors are expressed in terms of 1-dimensional harmonic polylogarithms of maximum weight 4.