PurposeThe COVID-19 epidemic is still spreading globally and will not be completely over in a short time. Wearing a mask is an effective means to combat the spread of COVID-19. However, whether the public wear a mask for epidemic prevention and control will be affected by stochastic factors such as vaccination, cultural differences and irrational emotions, which bring a high degree of uncertainty to the prevention and control of the epidemic. The purpose of this study is to explore and analyze the epidemic prevention and control strategies of the public in an uncertain environment.Design/methodology/approachBased on the stochastic evolutionary game model of the Moran process, the study discusses the epidemic prevention and control strategies of the public under the conditions of the dominance of stochastic factors, expected benefits and super-expected benefits.FindingsThe research shows that the strategic evolution of the public mainly depends on stochastic factors, cost-benefit and the number of the public. When the stochastic factors are dominant, the greater the perceived benefit, the lower the cost and the greater the penalty for not wearing masks, the public will choose to wear a mask. Under the dominance of expected benefits and super-expected benefits, when the number of the public is greater than a certain threshold, the mask-wearing strategy will become an evolutionary stable strategy. From the evolutionary process, the government’s punishment measures will slow down the speed of the public choosing the strategy of not wearing masks. The speed of the public evolving to the stable strategy under the dominance of super-expected benefits is faster than that under the dominance of expected benefits.Practical implicationsThe study considers the impact of stochastic factors on public prevention and control strategies and provides decision-making support and theoretical guidance for the scientific prevention of the normalized public.Originality/valueTo the best of the authors’ knowledge, no research has considered the impact of different stochastic interference intensities on public prevention and control strategies. Therefore, this paper can be seen as a valuable resource in this field.