COVID-19 has made the public aware that wearing masks is a simple yet effective protective measure when facing respiratory infectious diseases. However, despite this late stage of the pandemic, there have been few systematic studies of the physiological and subjective effects of wearing a mask, particularly on how they affect cognitive performance. To address this gap, we conducted an experiment simulating an office environment with three working conditions: no mask, surgical mask, and KN95 mask, 24 subjects and a comfortable ambient temperature of 23 degrees C; the exposure time to each condition was 160 min (mask was worn for 120 min). We collected data on cognitive performance, physiological parameters, and subjective feelings. The results revealed a significant decrease in the accuracy of a test of grammatical logic as the experiment progressed, regardless of the mask type worn; on average, accuracy was lower when wearing a surgical mask compared with no mask. After 80 min of exposure, the accuracy of a visual choice reaction time test significantly decreased when wearing a surgical mask compared to not wearing a mask, while Stroop accuracy improved slightly but significantly when wearing a KN95 mask. Regardless of mask type, pNN50, ETCO2, and facial skin temperature significantly increased compared to no mask, while wearing a mask reduced the subjects' evaluation of the quality of the thermal environment and the air quality and increased the intensity of some acute health symptoms. In summary, it was shown that wearing masks may impact cognitive performance, physiological responses and well-being.