A close coupling quantum-mechanical calculation is performed for rotational energy transfer in a HD + HD collision at very low energy, down to the ultracold temperatures: T ∼ 10 −8 K. A global six-dimensional H 2 -H 2 potential-energy surface is adopted from a previous work [Boothroyd et al., J. Chem. Phys. 116, 666 (2002)]. State-resolved integral cross sections σ ij →i j (ε kin ) of different quantum-mechanical rotational transitions ij → i j in the HD molecules and corresponding state-resolved thermal rate coefficients k ij →i j (T ) have been computed. Additionally, for comparison, H 2 + H 2 calculations for a few selected rotational transitions have also been performed. The hydrogen and deuterated hydrogen molecules are treated as rigid rotors in this work. A pronounced isotope effect is identified in the cross sections of these collisions at low and ultracold temperatures.