  We calculate hyperfine structure of $^{229}$Th and its ions (Th~IV, Th~III,
Th~II, Th~I) to reveal the dependence of the nuclear clock frequency on the
hyperfine interaction (hfi). We calculate first and second-order hfi shifts and
demonstrate that due to the differences in the hyperfine structure for
different ions and for the ground and isomeric nuclear states, the nuclear
frequencies in Th~IV, Th~III, Th~II and Th~I are also different. The
first-order shift of frequency is large for a particular hyperfine component,
but it vanishes after averaging over all hyperfine states. The second-order
shift is small but it does not vanish after averaging. It is three to six
orders of magnitude smaller than the shift of the nuclear frequencies due to
the Coulomb electron-nucleus interaction considered in our previous work (V. A.
Dzuba and V. V. Flambaum, arXiv:2309.11176 (2023)). However, it is six to eight
orders of magnitude larger than the projected accuracy of the nuclear clock
($10^{-19}$).
