This paper presents a convolutional neural network (CNN) model for face mask detection, addressing the enforcement of mask-wearing during the COVID-19 pandemic. The model demonstrated high accuracy rates of 99.72% on the real-world masked face dataset and 100% on simulated and labeled datasets, making it suitable for automated use in various public places. The study discusses the architecture and performance of the CNN, trained on multiple datasets, and compares results with existing methods in face mask detection.