Snacks served at schools that are contaminated with Escherichia coli germs run the risk of harming students' health. The World Health Organization states that around 70% of diarrheal disease cases are caused by food contaminated with Escherichia coli. Escherichia coli contamination in school snacks can be influenced by a lack of hygiene and sanitation aspects. This investigation aimed to establish a connection between good cleanliness habits and an E. coli infection in the cafeteria food at Nganjuk District's primary schools. This kind of study has an observational design and a cross-sectional study plan. The research sample consisted of 12 canteens selected through purposive sampling. Data collection methods included observation, interviews, and laboratory tests, followed by univariate analysis with descriptive statistics and bivariate analysis with Fisher's exact test. Laboratory test results explained that of the 12 samples, there were 5 (41.7%) foods contaminated with Escherichia coli. The outcomes demonstrated a link between the handler's hygiene (p = 0.015), sanitation of equipment (p = 0.028), serving process (p = 0.010), peddler facilities (p = 0.045), and Escherichia coli contamination. While the quality of food ingredients (p = 0.222) and TPM sanitation (p = 1.000) do not correlate with Escherichia coli contamination, It can be concluded that personal hygiene of the handler, sanitation of tools, serving process, and poor peddling facilities can increase the contamination of hawker food by Escherichia coli bacteria.