A theoretical study of the Fermi contact contribution to the H-H and H-D spin-spin coupling constant is reported, with special emphasis on its calculation using quantum chemical techniques over a wide range of internuclear distances, that has necessitated an extension of the existing methodology so the effects of near-degeneracy are properly treated. A detailed configuration interaction calculation on H 2 shows that as the molecule is stretched the coupling constant displays a sharp increase before decaying to zero as the molecule dissociates. Such distance dependence is reflected in the calculated vibrational averages of the coupling constant for HD that show a rapid increase with vibrational excitation.