We derive a full formula for the energy level of a heavy quarkonium state identified by the quantum numbers $n$, $ell$, $s$ and $j$, up to ${cal O}(alpha_s^5 m)$ and ${cal O}(alpha_s^5 m log alpha_s)$ in perturbative QCD. The QCD Bethe logarithm is given in a one-parameter integral form. The rest of the formula is given as a combination of rational numbers, transcendental numbers ($pi$, $zeta(3)$, $zeta(5)$) and finite sums (besides the 3-loop constant $bar{a}_3$ of the static potential whose full analytic form is still unknown). A derivation of the formula is given.