Objectives: To investigate the association between self-reported sleep duration, sleep quality and the prevalence of diabetes in a contemporary sample of Chinese adults. Design: Cross-sectional survey. Setting: Community-based investigation in Xuzhou, China. Participants: 16 893 Chinese men and women aged 18-75 who fulfilled the inclusion and exclusion criteria were enrolled. Primary and secondary outcome measures: Self-reported quality and duration of sleep were obtained by questionnaire, and type 2 diabetes was assessed by fasting blood glucose. Sleep quality was categorised as good, common or poor. Sleep duration was measured by average hours of sleep per night, with categories of <= 6 h, 6-8 h and >= 8 h. A logistic regression model was used to evaluate the association between sleep duration or sleep quality and diabetes. Results: Both poor quality of sleep and short sleep duration (<= 6 h) were associated with increased prevalence of diabetes, with higher rates in relatively healthy Chinese people. Compared with the group with good quality of sleep and 6-8 h sleep duration, diabetes was the most prevalent in individuals with poor sleep quality and <= 6 h sleep duration (OR 1.41, 95% CI 1.07 to 1.85) and in those with poor sleep quality who slept >= 8 h (OR 1.39, 95% CI 0.85 to 2.26), even after adjustment for a large number of further possible factors. Conclusions: The results suggest that sleep of poor quality and short duration is associated with diabetes.