The dissociation of H2 and its isotopologues through excitation to the singlet ungerade continua is one of the major channels for the production of slow hydrogen atoms at high temperature (T > 10 000 K) and electron energy >25 eV. State-specific photodissociation cross sections and oscillator strengths for molecular deuterium from the X 1Σ+g(vi, Ji) levels to the continuum levels of the B 1Σ+u, C 1Πu, B′ 1Σ+u, D 1Πu, B, D′ 1Πu and 5pσ 1Σ+u states have been calculated. The corresponding (vi, Ji) state-specific electron impact dissociation cross sections have been obtained for the first time over a wide energy range using calculated continuum oscillator strengths along with previously published excitation functions of the Lyman and Werner bands. Estimated cross sections to the higher (n ⩾ 5) npσ 1Σ+u and npπ 1Πu continua are also provided. Both photon and electron impact excitation cross sections show strong dependences on the initial (vi, Ji) quantum numbers. Thermally averaged electron impact cross sections of all singlet ungerade states increase monotonically with temperature. While excitation to the B′ 1Σ+u continuum is the dominant dissociation channel at room temperature, the C 1Πu and B 1Σ+u continua become more important at high temperature (>5000 K). The large increase of the C 1Πu and B 1Σ+u cross sections with (vi, Ji) is primarily responsible for making the continuum dissociation from a minor break-up channel at room temperature into a major one at high temperature. The electron dissociation cross section of D2 via the singlet ungerade continua is smaller than its H2 counterpart, although this difference decreases with temperature. This work, along with the previous calculations of H2 by Liu et al (2009, 2012), provides the complete electron impact dissociation cross sections of H2 and D2 through the singlet ungerade continua. Thermally averaged electron dissociation cross sections are provided at various temperatures for applications in plasma physics.