Abstract Background Ulcerative colitis (UC) is a debilitating chronic condition that affects the large intestine and courses with episodes of flare and remission, being steroid-free remission the main treatment goal. Our aim was to assess the prevalence of self-medication with analgesics, and its associated factors in a Spanish cohort of UC patients. Methods An anonymous cross-sectional survey was developed by 3 IBD experts from the Spanish working group on Crohn’s disease (CD) and Ulcerative Colitis (GETECCU), one nurse of the Spanish nursing working group on inflammatory bowel disease (GETEII) and two patients from the Spanish confederation of associations of patients with CD and UC (ACCU). A link to the online survey was distributed to the ACCU affiliates and to other adult patients with UC through 50 inflammatory bowel disease (IBD) units from Spain. Participants voluntarily answered to the survey based on their own experiences during the last year. Results We collected data from 546 patients, 61% women, mean age 40 years old. Of these, 51% patients were followed-up by IBD specialists and 47% by a general gastroenterologist. Patients’ self-reported disease activity during the last year was: 125 (23%) inactive, 188 (34%) mild, 170 (31%) moderate and 63 (12%) severe. Visits to the emergency room (24%), urgent telephone calls (43%) and hospital admissions (10%) were reported by patients during the last year. A total of 320 (59%) patients declared to have self-medicated with analgesics during the past year, mostly with paracetamol [n = 247 (45%)] and metamizole [118 (22%)], followed by ibuprofen [26 (5%)] and codeine [23 (4%)]. The frequency of self-medication was higher in those patients who declared having a moderate (57%) to severe (65%) disease activity, compared with those who felt their disease was mild (45%) or inactive (39%), (p < 0.001). In addition, patients who needed urgent telephone assistance showed a higher frequency of self-medication (n = 139, 59%) [OR 2 (95% CI:1–3), p < 0.001]. Multivariate analysis revealed that self-medication with analgesics was associated to female gender [OR 2 (95% CI: 1–3), p < 0.001], intravenous (IV) biological therapy [OR 3 (95% CI: 2–5), p < 0.001] and visits to the emergency room [OR 3 (95% CI: 2–4), p < 0.001]. Conclusion Self-medication with analgesics is a common practice in patients with UC from Spain. Factors like being a woman, treatment with IV biological drugs, needing urgent telephone assistance and attending to the emergency room, were associated with self-medication with analgesics. This project was endorsed by GETECCU, GETEII, ACCU and funded by MSD Spain.