In Italy, it has been difficult to accurately quantify hospital admissions of patients with a COVID-19 diagnosis using the Hospital Information System (HIS), mainly due to the heterogeneity of codes used in the hospital discharge records during different waves of the COVID-19 pandemic. The objective of this study was to define a specific combination of codes to identify the COVID-19 hospitalizations within the HIS and to investigate the risk factors associated with mortality due to COVID-19 among patients admitted to Italian hospitals in 2020. A retrospective study was conducted using the hospital discharge records, provided by more than 1300 public and private Italian hospitals. Inpatient hospitalizations were detected by implementing an algorithm based on specific International Classification of Diseases, Ninth Revision, Clinical Modification (ICD-9-CM) code combinations. Hospitalizations were analyzed by different clinical presentations associated with COVID-19 diagnoses. In addition, 2 multivariable Cox regression models were performed among patients hospitalized "due to COVID-19" from January 1 to December 31, 2020, to investigate potential risk factors associated with 30-day death and the temporal changes over the course of the pandemic; in particular, the 30-day death rates during the first and the second waves were analyzed across 3 main geographical areas (North, Center, and South and Islands) and by discharge wards (ordinary and intensive care). We identified a total of 325,810 hospitalizations with COVID-19-related diagnosis codes. Among these, 73.4% (n=239,114) were classified as "due to COVID-19," 14.5% (n=47,416) as "SARS-CoV-2 positive, but not due to COVID-19," and 12.1% (n=39,280) as "suspected COVID-19" hospitalizations. The cohort of patients hospitalized "due to COVID-19" included 205,048 patients, with a median age of 72 years and a higher prevalence of male patients (n=124,181, 60.6%). The overall 30-day death rate among hospitalized patients due to COVID-19 was 9.9 per 1000 person-days. Mortality was lower for women (hazard ratio [HR]=0.83; P<.001) and for patients coming from high migration pressure countries, especially Northern Africans (HR=0.65; P<.001) and Central and Eastern Europeans (HR=0.66; P<.001), compared to patients coming from Italy and high-income countries. In the southern regions and the Islands, mortality was higher compared to the northern regions (HR=1.17; P<.001), especially during the second wave of COVID-19 among patients with a transfer to intensive care units (HR=2.52; P<.001). To our knowledge, the algorithm is the first attempt to define, at a national level, selection criteria for identifying COVID-19 hospitalizations within the HIS. The implemented algorithm will be used to monitor the pandemic over time, and the patients selected in 2020 will be followed up in the next years to assess the long-term effects of COVID-19.