ObjectivesType 2 diabetes mellitus (T2DM) is a serious public health issue. Compared with the general population, patients with T2DM have a higher risk of poor sleep quality, which could ultimately result in poor prognosis. Therefore, this study aimed to evaluate sleep quality and its associated factors among patients with T2DM in Hunan, China.DesignThis was a cross-sectional study.SettingA tertiary hospital in Hunan, China.ParticipantsPatients with T2DM hospitalised at the Endocrinology Department were consecutively enrolled between March 2021 and December 2022. Sociodemographic characteristics, lifestyle factors and T2DM-related information were collected retrospectively.Primary and secondary outcome measuresSleep quality was evaluated using the Pittsburgh Sleep Quality Index, with a cut-off value of >7 suggesting poor sleep quality. Multivariate logistic regression analysis was used to determine factors associated with poor sleep quality.ResultsOf the 1039 participants included, 1001 provided complete data. The mean age of the study sample was 60.24±10.09 years, and 40.5% (95% CI 37.5% to 43.5%) of patients had poor sleep quality. Multivariate logistic regression analysis showed that female sex (adjusted OR (aOR) 1.70, 95% CI 1.25 to 2.29), unmarried status (aOR 1.72, 95% CI 1.05 to 2.83), diabetic retinopathy (aOR 1.38, 95% CI 1.04 to 1.83), diabetic foot (aOR 1.80, 95% CI 1.11 to 2.93) and a per capita monthly household income of >5000 RMB (aOR 0.66, 95% CI 0.47 to 0.93) were associated with poor sleep quality.ConclusionsNearly two-fifths of patients with T2DM reported poor sleep quality in Hunan, China. Sex, marital status, diabetic retinopathy, diabetic foot and household income were independently associated with sleep quality among patients with T2DM in Hunan, China.