question: Background: During the outbreak of coronavirus disease 2019 (COVID-19), occupational differences were recognized with respect to psychological issues, but there are no reports regarding the insomnia and anxiety comorbidities and their related factors among the general public and medical staff. Our study aimed to compare the prevalence of anxiety and anxiety with insomnia, as well as the relationship between different psychological symptoms between the two groups. Methods: A total of 605 medical staff and 1091 public respondents were assessed through an online questionnaire survey, including the 7-item Insomnia Severity Index (ISI), the somatization subscale of Symptom Checklist 90-Revised (SCL-90-R), and the 7-item Generalized Anxiety Disorder scale (GAD-7). Results: Compared with the general public, medical staff had a higher incidence of anxiety (45.5% vs 32.4%). The incidence of insomnia in anxious participants was 52.7% in medical staff and 44.6% in the general public, and the difference was significant (p &lt; 0.05). The GAD-7 score and somatization subscore of the SCI-90 were independently associated with insomnia among anxiety participants in both groups (all p &lt; 0.001). Conclusion: Our findings suggest that during the epidemic period of COVID-19, medical staff experienced more anxiety and anxiety with insomnia. Somatization, anxiety and insomnia are highly correlated among medical staff and the general public.