Abstract Background The coronavirus disease 2019 (COVID-19) cases continue to rise, and the demand for medical treatment and resources in healthcare systems surges. Assessing the viral shedding time (VST) of patients with COVID-19 can facilitate clinical decision making. Although some studies have been conducted on the factors affecting the VST of severe acute respiratory syndrome coronavirus 2 (SARS-COV-2), few prediction models are currently available. Methods This retrospective study included the consecutive patients with COVID-19 admitted to Xi’an Chest Hospital in Shaanxi, China, for treatment between December 19, 2021 and February 5, 2022. The clinical data of the patients were extracted from their electronic medical records. Combining significant factors affecting the VST, a nomogram was developed to predict the VST of the SARS-CoV-2 Delta variant in patients with COVID-19. Results We included 332 patients in this study. The average VST was 21 d. VST was significantly prolonged in patients with severe clinical symptoms, sore throat, old age, long time from onset to diagnosis, and an abnormal white blood cell count. Consequently, we developed a nomogram prediction model using these 5 variables. The concordance index (C-index) of this nomogram was 0.762, and after internal validation using bootstrapping (1000 resamples), the adjusted C-index was 0.762. The area under the nomogram’s receiver operator characteristic curve showed good discriminative ability (0.965). The calibration curve showed high consistency. The VST was prolonged in the group with lower model fitting scores according to the Kaplan-Meier curve (χ2=286, log-rank P < 0.001). Conclusions We developed a nomogram for predicting VST based on 5 easily accessible factors. It can effectively estimate the appropriate isolation period, control viral transmission, and optimize clinical strategies.