Numerous diseases that involve the gastrointestinal tract reveal the presence of granulomas on histological analysis. Granulomatous diseases can be either primary or secondary to environmental factors. Granulomas are dynamic structures composed of organized collections of activated macrophages, including epithelioid and multinucleated giant cells, surrounded by lymphocytes. The formation of granulomas is usually in response to antigenic stimulation and is orchestrated through cytokines, immune cells and host genetics. In this Review, the pathogenesis and etiologies of granulomas of the gastrointestinal tract and liver are discussed, as are the available diagnostic tools to help differentiate their various underlying etiologies. In addition, the role of granulomas in harboring latent tuberculosis is reviewed. The effects of tumor necrosis factor antagonists and interferon-α on the development of granulomas are also discussed.