BACKGROUND Irritable bowel syndrome (IBS) and functional dyspepsia (FD) are common functional disorders without defined pathology. Mast cells and eosinophils interact with T lymphocytes and may alter enteric nerve and smooth muscle function. AIM To examine mast cell, eosinophil and intraepithelial lymphocyte populations in duodenal biopsies of subjects with IBS and FD. METHODS A random sample of an adult Swedish population (n = 1001; mean age 54 years; 51% female) underwent upper endoscopy and biopsy; 51 cases with FD and 41 cases with IBS were compared with 48 randomly selected controls. Eosinophils were identified by light microscopy; mast cells by immunocytochemistry (CD117). Intraepithelial lymphocytes were counted per 100 enterocytes. Cell counts were quantified by counting the number per high power field (HPF) in 5HPFs in the bulb (D1) and second part of duodenum (D2), summed over 5HPFs at each site. RESULTS Cases and controls showed similar demographics. Compared to controls, IELs in IBS-constipation were significantly increased (P = 0.005). Mast cells were significantly increased in IBS in D2 (P < 0.001), while eosinophils were significantly increased in FD in D1 and D2 (P < 0.001). CONCLUSION Duodenal mast cell hyperplasia is linked to IBS and eosinophilia to FD, and duodenal biopsy may identify subsets of these disorders.