Multichannel quantum-defect theory (MQDT) is used to calculate the electron binding energies of np Rydberg states of H2, HD, and D2 around n = 60 at an accuracy of better than 0.5 MHz. The theory includes the effects of rovibronic channel interactions and the hyperfine structure, and has been extended to the calculation of the asymmetric hyperfine structure of Rydberg states of a heteronuclear diatomic molecule (HD). Starting values for the eigenquantum-defect parameters of MQDT were extracted from ab initio potential-energy functions for the low-lying p Rydberg states of molecular hydrogen and subsequently refined in a global weighted fit to available experimental data on the singlet and triplet Rydberg states of H2 and D2. The electron binding energies of high-np Rydberg states derived in this work represent important quantities for future determinations of the adiabatic ionization energies of H2, HD, and D2 at sub-MHz accuracy.