Objective: To evaluate the efficacy and safety of hydroxychloroquine (HCQ) in the treatment of patients with moderate coronavirus disease 2019 (COVID-19). Methods: We prospectively enrolled 30 treatment-naïve patients with confirmed COVID-19 after informed consent at Shanghai Public Health Clinical Center. The patients were randomized 1:1 to HCQ group and the control group. Patients in HCQ group were given HCQ 400 mg per day for 5 days plus conventional treatments, while those in the control group were given conventional treatment only. The primary endpoint was negative conversion rate of SARS-CoV-2 nucleic acid in respiratory pharyngeal swab on days 7 after randomization. This study has been approved by the Ethics Committee of Shanghai Public Health Clinical Center and registered online (NCT04261517). Results: One patient in HCQ group developed to severe during the treatment. On day 7, nucleic acid of throat swabs was negative in 13 (86.7%) cases in the HCQ group and 14 (93.3%) cases in the control group (P>0.05). The median duration from hospitalization to virus nucleic acid negative conservation was 4 (1, 9) days in HCQ group, which is comparable to that in the control group [2 (1, 4) days, Z=1.27, P>0.05]. The median time for body temperature normalization in HCQ group was 1 (0, 2) day after hospitalization, which was also comparable to that in the control group [1 (0, 3) day]. Radiological progression was shown on CT images in 5 cases (33.3%) of the HCQ group and 7 cases (46.7%) of the control group, and all patients showed improvement in follow-up examinations. Four cases (26.7%) of the HCQ group and 3 cases (20%) of the control group had transient diarrhea and abnormal liver function (P>0.05). Conclusions: The prognosis of COVID-19 moderate patients is good. Larger sample size study are needed to investigate the effects of HCQ in the treatment of COVID-19. Subsequent research should determine better endpoint and fully consider the feasibility of experiments such as sample size.