Vitamin D deficiency is associated with several adverse health outcomes, and vitamin D appears to have systemic antimicrobial effects that may be crucial in a variety of both acute and chronic illnesses. In the present study, 25-hydroxyvitamin D (25-OHD) levels were compared among patients with chronic hepatitis B virus infection, naturally immunized individuals and control individuals. Thirty-five patients with chronic hepatitis B virus infection (group I), 30 naturally immunized individuals (group II) and 30 healthy adults were included in the present study. Markers of hepatitis were measured using commercially available kits based on chemiluminescence assays. Routine biochemical parameters, hepatitis B virus serology, hepatitis B virus DNA, 25-OHD and parathyroid hormone levels were measured. Baseline characteristics of the study groups were comparable. Patients in group I had a lower 25-OHD level compared with group II and the control group (7.65±4.19 ng/mL versus 12.1±7.13 ng/mL and 14.17±9.18 ng/mL, respectively; P<0.001). In addition, patients in group I had a higher parathyroid hormone level compared with group II and the control group (88.21±34.2 ng/mL versus 75.14±23.4 ng/mL and 74.16±20.15 ng/mL, respectively; P=0.001). 25-OHD levels were correlated with hepatitis B virus DNA levels. In patients infected with hepatitis B virus, diminished 25-OHD levels may be an indicator of the status of viral replication and portends a poor prognosis.