Patients with chronic pain often complain about cognitive difficulties, and since these symptoms represent an additional source of suffering and distress, evaluating the cognitive status of these patients with valid and reliable tests should be an important part of their overall assessment. Although cognitive impairment is a critical characteristic of pain, there is no specific measure designed to detect these effects in this population. The objective was to analyze the psychometric properties of the "Test Your Memory" (TYM) test in patients with chronic pain of three different origins. A cross-sectional study was carried out on 72 subjects free of pain and 254 patients suffering from different types of chronic pain: neuropathic pain (104), musculoskeletal pain (99) and fibromyalgia (51). The construct validity of the TYM was assessed using the Mini-Mental State Examination (MMSE), Hospital Anxiety and Depression Scale (HADs), Index-9 from MOS-sleep, SF-12, and through the intensity (Visual Analogical Scale) and duration of pain. An exploratory factor analysis was also performed and internal reliability was assessed using Cronbach's alpha. After adjusting for potential confounders the TYM could distinguish between pain and pain-free patients, and it was correlated with the: MMSE (0.89, p<0.001); HAD-anxiety (-0.50, p<0.001) and HAD-depression scales (-0.52, p<0.001); MOS-sleep Index-9 (-0.49, p<0.001); and the physical (0.49, p < .001) and mental components (0.55, p < .001) of SF-12. The exploratory structure of the TYM showed an 8-factor solution that explained 53% of the variance, and Cronbach's alpha was 0.66. The TYM is a valid and reliable screening instrument to assess cognitive function in chronic pain patients that will be of particular value in clinical situations.