In the last few years, more attention has been given to the "non-calcemic" effect of vitamin D. Several observational studies and meta-analyses demonstrated an association between circulating levels of vitamin D and outcome of many common diseases, including endocrine diseases, chronic diseases, cancer progression, and autoimmune diseases. In particular, cells of the immune system (B cells, T cells, and antigen presenting cells), due to the expression of 1α-hydroxylase (CYP27B1), are able to synthesize the active metabolite of vitamin D, which shows immunomodulatory properties. Moreover, the expression of the vitamin D receptor (VDR) in these cells suggests a local action of vitamin D in the immune response. These findings are supported by the correlation between the polymorphisms of the VDR or the CYP27B1 gene and the pathogenesis of several autoimmune diseases. Currently, the optimal plasma 25-hydroxyvitamin D concentration that is necessary to prevent or treat autoimmune diseases is still under debate. However, experimental studies in humans have suggested beneficial effects of vitamin D supplementation in reducing the severity of disease activity. In this review, we summarize the evidence regarding the role of vitamin D in the pathogenesis of autoimmune endocrine diseases, including type 1 diabetes mellitus, Addison's disease, Hashimoto's thyroiditis, Graves' disease and autoimmune polyendocrine syndromes. Furthermore, we discuss the supplementation with vitamin D to prevent or treat autoimmune diseases.