ObjectiveThis research aimed to assess the levels of cognitive function and its contributing factors among individuals experiencing cancer pain (CP) in mainland China.DesignA descriptive, cross-sectional study.SettingThe investigation was undertaken within three tertiary oncology hospitals.ParticipantsWe included 220 hospitalised individuals who reported experiencing cancer-related pain and consented to complete the research questionnaires.Outcome measuresThe collected data encompassed sociodemographic and clinical variables, augmented by results from validated questionnaires. Cognitive impairment (CI) was evaluated using the Functional Assessment of Cancer Therapy-Cognitive (FACT-Cog) scale, with scores ranging from 0 to 148. Sleep quality, depression and anxiety were assessed through the Pittsburgh Sleep Quality Index, the Patient Health Questionnaire-9 and the Generalised Anxiety Disorder-7, respectively. A binary logistic regression model was used to identify factors associated with CI in individuals with CP.ResultsOf the 225 individuals approached, 220 (97.8%) participated in the study. The mean FACT-Cog score for those with CP was 101.29 (SD=25.24; range=25–148). The prevalence of CI among these individuals was 35.90%. Sleep quality was rated below medium in 45% of participants with CP. More than moderate pain was reported by 28.2%, with 64.6% experiencing depression and 38.6% experiencing anxiety. Increased odds of developing CI were observed in those with CP (OR 1.422, 95% CI 1.129 to 1.841), depression (OR 1.119, 95% CI 1.029 to 1.2117), anxiety (OR 1.107, 95% CI 1.005 to 1.220), advancing age (OR 1.042, 95% CI 1.013 to 1.073), poor sleep quality (OR 1.126, 95% CI 1.013 to 1.252) and a history of smoking (OR 3.811, 95% CI 1.668 to 8.707).ConclusionsCI associated with CP is notably prevalent in China. Those older, with a smoking history, inadequate sleep, more severe pain, depression and anxiety, have a heightened risk of CI. Consequently, interventions need to be personalised, addressing these key determinants.