Congenital heart disease (CHD) is associated with various neurocognitive deficits, particularly targeting executive functions (EFs), of which random number generation (RNG) is one indicator. RNG has, however, never been investigated in CHD. We administered the Mental Dice Task (MDT) to 67 young adults with CHD and 55 healthy controls. This 1-minute-task requires the generation of numbers 1 to 6 in a random sequence. RNG performance was correlated with a global EF score. Participants underwent MRI to examine structural-volumetric correlates of RNG. Compared to controls, CHD patients showed increased backward counting, reflecting deficient inhibition of automatized behavior. They also lacked a small-number bias (higher frequency of small relative to large numbers). RNG performance was associated with global EF scores in both groups. In CHD patients, MRI revealed an inverse association of counting bias with most of the volumetric measurements and the amount of small numbers was positively associated with corpus callosum volume, suggesting callosal involvement in the “pseudoneglect in number space”.In conclusion, we found an impaired RNG performance in CHD patients, which is associated with brain volumetric measures. RNG, reportedly resistant to learning effects, may be an ideal task for the longitudinal assessment of EFs in patients with CHD.