Purpose Vitamin D is increasingly being recognized as an important mediator of immune function and may have a preventive role in the pathogenesis of periprosthetic joint infection. To the best of our knowledge, no other study has examined possible associations between periprosthetic joint infection and vitamin D deficiency. We investigated the rate of vitamin D deficiency in patients treated for periprosthetic joint infection and whether vitamin D deficiency is independent of other risk factors for vitamin D deficiency in patients with periprosthetic joint infection. Methods Serum 25-hydroxyvitamin D (25OHD) levels of every patient scheduled to receive a total prosthesis either of the hip, knee, or shoulder in the orthopaedic department of the Johannes-Guttenberg-University Hospital in Mainz, Germany (109 patients), were measured after admission. Furthermore, serum 25OHD levels were measured for every patient presenting with periprosthetic joint infection (n=50) or aseptic loosening of the prosthesis (n=31) scheduled to undergo revision surgery. The prevalence of normal (>30 ng/ml), insufficient (20-30 ng/ml), and deficient (<20 ng/ml) 25OHD levels was determined. Results All tested patient subgroups showed low vitamin D levels. Statistical analysis found no significant difference in vitamin D levels comparing patients with prosthesis and patients with aseptic prosthesis loosening (p=0.58). Significant differences in 25OHD levels were found comparing patients with periprosthetic joint infection and patients scheduled for primary arthroplasty (p<0.001). In addition, we found a significant difference (p<0,001) in 25OHD levels of patients with periprosthetic joint infection compared with patients with aseptic prosthesis loosening. Conclusion We found a high frequency of vitamin D deficiency in patients being treated by primary arthroplasty and those with aseptic joint prosthetic loosening and periprosthetic joint infection. Vitamin D deficiency was severe in patients with periprosthetic joint infection.