During the SARS-CoV-2 pandemic, the air quality and infection risk in classrooms were the focus of many investigations. Despite general recommendations for sufficient ventilation, quantitative analyses were often lacking due to the large number of combinations of boundary conditions. Hence, in this paper, we describe a computational fluid dynamics model that predicts the time-resolved airflow for a typical 45min classroom scenario. We model 28 students and a teacher, each emitting CO2 and an individual aerosol. We investigated 13 ventilation setups with window or mechanical ventilation and different positions and operating conditions of an additional air purifier. The ventilation performance is assessed by evaluating the ventilation effectiveness, aerosol removal effectiveness, local air exchange efficiency and overall inhaled aerosol mass of the occupants, which is a measure of the infection risk. If the window is opened according to the “20-5-20” recommendation, the incoming airflow reduces both the CO2 and aerosol concentration whilst decreasing the thermal comfort at low ambient temperatures. An active air purifier enhances aerosol removal, but, depending on the position, the local air exchange efficiency and individual aerosol inhalation vary. If mechanical ventilation with 700 m3/h is utilised, the CO2 concentration is kept below 1250 ppm while also effectively removing aerosol from the classroom.