This paper investigates the association between individually measured socioeconomic status (SES) and all-cause survival in colorectal cancer patients, and explores whether factors related to the patient, the disease, or the surgical treatment mediate the observed social gradient. The data were derived from a nationwide clinical database of all adenocarcinomas of the colon or rectum diagnosed in Denmark between 2001 and 2004 (inclusive). These data were linked to those from several central registries providing information on income, education, and housing status, as well as to data on comorbidity from previous hospitalizations and use of medication. Only patients with colorectal cancer as their first primary tumour and those born after 1920 were included. A total of 8763 patients were included in the study. Cox proportional hazard regression models revealed a positive social gradient in survival for increasing levels of education and income, and in owners versus renters of housing. A series of regression analyses were used to test potential mediators of the association between the socioeconomic indicators and survival by stepwise inclusion of lifestyle factors (smoking, alcohol intake, body mass index), comorbidity, stage of disease, mode of admission, type of operation, specialization of the surgeon, and curative versus palliative resection. A causal diagram guided the analyses. Inclusion of comorbidity, and to a lesser extent lifestyle, reduced the variation associated with SES, while no evidence of a mediating effect was found for disease or surgical treatment factors. This indicates that the difference in survival among colorectal cancer patients from different social groups was probably not caused by unintentional differences in treatment factors related to surgery, and suggests that primary prevention of chronic diseases among the socially deprived might be one way to reduce social differences in prognosis.