The incidence and prevalence of inflammatory bowel disease (IBD) are increasing worldwide. Some ecological studies show increasing incidence with increasing latitude. Ambient ultraviolet radiation varies inversely with latitude, and sun exposure of the skin is a major source of vitamin D. Vitamin D deficiency is common in patients with IBD. Sun exposure and vitamin D have immune effects that could plausibly reduce, or be protective for, IBD. One quarter of new IBD cases are diagnosed in childhood or adolescence, but most research is for adult-onset IBD. Here, we review the evidence for low sun exposure and/or vitamin D deficiency as risk factors for IBD, focusing where possible on pediatric IBD, where effects of environmental exposures may be clearer. The literature provides some evidence of a latitude gradient of IBD incidence, and evidence for seasonal patterns of timing of birth or disease onset is inconsistent. High prevalence of vitamin D deficiency occurs in people with IBD, but cannot be interpreted as being a causal risk factor. Evidence of vitamin D supplementation affecting disease activity is limited. Further research on predisease sun exposure and well-designed supplementation studies are required to elucidate whether these potentially modifiable exposures are indeed risk factors for IBD.