  Precision spectroscopy of hyperfine splitting (HFS) is a crucial tool for
investigating the structure of nuclei and testing quantum electrodynamics
(QED). However, accurate theoretical predictions are hindered by two-photon
exchange (TPE) effects. We propose a novel formalism that accounts for nuclear
excitations and recoil in TPE, providing a model-independent description of TPE
effects on HFS in light ordinary and muonic atoms. Combining our formalism with
pionless effective field theory at next-to-next-to-leading order, the predicted
TPE effects on HFS are 41.2(2.6) kHz and 0.116(9) meV for the 1S state in
deuterium and the 2S state in muonic deuterium. These results are within
1.4-1.7 standard deviation from recent measurements and highlight the
importance of nuclear structure effects on HFS and indicate the value of more
precise measurements in future experiments.
