Abstract Background Hygiene behaviors in public toilets are important to prevent the transmission of infectious diseases, especially during the pandemic. All through the novel coronavirus (COVID-19) pandemic, governments in many countries published guidance on personal hygiene for the general population to prevent disease transmission. This study aimed to investigate improvements in residents’ hygiene awareness and behaviors in public toilets before and during the pandemic. Methods We recruited 316 residents between November and December 2018 before the pandemic, and 314 residents between December 2020 and January 2021 during the pandemic in the same study sites in Hangzhou, a well-developed city in China. Residents’ hygiene behaviors in public toilets, hygiene awareness, risk perception, and sociodemographic factors were collected. Bivariate analysis and multivariable logistic regressions were used to test the differences between the two rounds. We conducted an observational study to record the provision of hygiene amenities at toilets during the pandemic. Results After controlling for sociodemographic factors (gender, marital status, age, education level, and monthly household income), compared with respondents recruited before the pandemic, respondents recruited during the pandemic were more likely to perceive the risks of infection when using public toilets (aOR = 1.77, 95%CI [1.20, 2.60]), and were more likely to be aware of the risks of touching contaminated toilet facilities (aOR = 1.72, 95%CI [1.17, 2.54]) and the risks of not using soap to wash one’s hands after using the toilet (aOR = 1.93, 95%CI [1.38, 2.72]). They were more likely to always clean their toilet seat with alcohol (aOR = 1.88, 95%CI [1.01, 3.51]), wash hands with soap (aOR = 1.52, 95%CI [1.09, 2.10]) and dry their hands with a dryer (aOR = 1.78, 95%CI [1.16, 2.71]), but they were less likely to always wash their hands after using the toilets (aOR = 0.57, 95%CI [0.32, 1.00]). Among 70 public toilets observed, 9 provided alcohol for toilet seat disinfection, 52 provided soap, 33 provided paper towels, and 41 had working hand dryers. Conclusions Despite the overall improvement, residents’ hygiene behaviors in public toilets and the supply of hygiene amenities were still suboptimal during the pandemic. Further hygiene education and an adequate supply of hygiene amenities in public toilets are needed to promote residents’ hygiene behaviors.