Research discusses the role of vitamin D in both type 1 and type 2 diabetes pathogenesis. It summarizes the molecular mechanisms of vitamin D in insulin secretion, insulin sensitivity, and immunity, as well as the observational and interventional human studies investigating the use of vitamin D as a treatment for diabetes.