We use the time-independent quantum-mechanical formulation of reactive collisions in order to investigate the state-to-state H + + HD → D + + H 2 chemical reaction. We compute cross sections for collision energies up to 1.8 electron-volts and rate coefficients for temperatures up to 10000 kelvin. We consider HD in the lowest vibrational level v = 0 and rotational levels j = 0 to 4, and H 2 in vibrational levels v ′ = 0 to 3 and rotational levels j ′ = 0 to 9. For temperatures below 4000 kelvin, the rate coefficients strongly vary with the initial rotational level j, depending on whether the reaction is endothermic ( j ≤ 2) or exothermic ( j ≥ 3). The reaction is also found less and less probable as the final vibrational quantum number v ′ increases. Our results illustrate the importance of studying state-to-state reactions, in the context of the chemistry of the primordial universe.