BACKGROUND AND OBJECTIVES: Since December 2019, the rapid epidemic spread of COVID-19 in China has aroused the attention of the government and the public. The purpose of this study is to investigate the attitude and knowledge among medical students and non-medical students toward SARS-CoV-2 infection. METHODS: A web-based survey was disseminated to the students from medical colleges and comprehensive universities via the survey website (www.wjx.cn) and via WeChat. Participation in the study was voluntary with the instruction to click on the website or scan the QR code to complete the anonymous electronic questionnaire from February 5 to 7, 2020. RESULTS: The questionnaire was completed by 588 students from 20 colleges and universities in China. Of the respondents, 66.0% were medical students and 34.0% were non-medical students. 99.6 % of the students held an optimistic attitude toward the COVID-19 epidemic situation. The majority of participants had a good level of knowledge of common symptoms, transmission, and prevention of the disease. In a comparison between non-medical students with medical students, the medical students had a deeper understanding of COVID-19. In this study, we also found that female students had a better understanding of transmission and prevention than male students did. CONCLUSIONS: The majority of students who participated in the questionnaire had a positive attitude and a good perception about COVID-19.