Context. The deuteration of molecules forming in the ices such as methanol (CH 3 OH) is sensitive to the physical conditions during their formation in dense cold clouds and can be probed through observations of deuterated methanol in hot cores. Aims. The aim is to determine the D/H ratio of methanol for a large sample of 99 high-mass protostars and to link this to the physical conditions during the formation of methanol in the prestellar phases. Methods. Observations with the Atacama Large Millimeter/submillimeter Array (ALMA) containing transitions of CH 3 OH, CH 2 DOH, CHD 2 OH, 13 CH 3 OH, and CH 18 3 OH are investigated. The column densities of CH 2 DOH, CHD 2 OH, and CH 3 OH are determined for all sources, where the column density of CH 3 OH is derived from optically thin 13 C and 18 O isotopologues. Consequently, the D/H ratio of methanol is derived taking statistical effects into account. Results. Singly deuterated methanol (CH 2 DOH) is detected at the 3σ level toward 25 of the 99 sources in our sample of the highmass protostars. Including upper limits, the (D/H) CH 3 OH ratio inferred from N CH 2 DOH /N CH 3 OH was derived for 38 of the 99 sources and varies between ∼ 10 −3 − 10 −2 . Including other high-mass hot cores from the literature, the mean methanol D/H ratio is 1.1 ± 0.7 × 10 −3 . This is more than one order of magnitude lower than what is seen for low-mass protostellar systems (2.2 ± 1.2 × 10 −2 ). Doubly deuterated methanol (CHD 2 OH) is detected at the 3σ level toward 11 of the 99 sources. Including upper limits for 15 sources, the (D/H) CH 2 DOH ratios derived from N CHD 2 OH /N CH 2 DOH are more than two orders of magnitude higher than (D/H) CH 3 OH with an average of 2.0 ± 0.8 × 10 −1 which is similar to what is found for low-mass sources. Comparison with literature GRAINOBLE models suggests that the high-mass prestellar phases are either warm (> 20 K) or live shorter than the free-fall timescale. In contrast, for low-mass protostars, both a low temperature of < 15 K and a prestellar phase timescale longer than the free-fall timescale are necessary. Conclusions. The (D/H) CH 3 OH ratio drops by more than an order of magnitude between low-mass and high-mass protostars due to either a higher temperature during the prestellar phases or shorter prestellar phases. However, successive deuteration toward CHD 2 OH seems equally effective between low-mass and high-mass systems.