Inflammation can result from a range of sources including microbial infections, exposure to allergens and toxic chemicals, autoimmune disease and obesity. A well-balanced immune response can be anti-tumorigenic; however, a sustained or chronic inflammatory response is generally harmful as the immune response becomes distorted. A causal link between chronic inflammation and cancer is now well accepted and many chronically inflamed organs of the gastrointestinal tract show this association. For example, patients with inflammatory bowel disease (IBD), including both ulcerative colitis and Crohn's disease, have a 2- to 3-fold greater lifetime risk of developing colorectal cancer compared with the general population. The development of colitis-associated cancer (CAC) is thought to be multifaceted and is probably due to a combination of genetic factors, epigenetic factors and the duration, extent and severity of disease. Recently, epigenetic alterations, in particular alterations in DNA methylation, have been observed during inflammation and inflammation-associated carcinogenesis. The mediators of this, the significance of these changes in DNA methylation and the effect this has on gene expression and the malignant transformation of the epithelial cells during IBD and CAC are discussed in this review. The recent advances in technologies to study genome-wide DNA methylation and the therapeutic potential of understanding these molecular mechanisms are also highlighted.