Hepatocellular carcinoma (HCC) is one of the most common cancers globally, seriously endangering people health. Vitamin D was significantly associated with tumor progression and patients’ prognosis. Integrative 10 machine learning algorithms were used to develop a Vitamin D-related signature (VRS) with one training cohort and 3 testing cohorts. The performance of VRS in predicting the immunology response was verified using several predicting approaches. The optimal VRS was constructed by stepCox + superPC algorithm. VRS acted as a risk factor for HCC patients. HCC patients with high-risk score had a poor clinical outcome and the AUCs of 1-, 3-, and 5-year ROC were 0.786, 0.755, and 0.786, respectively. A higher level of CD8 + cytotoxic T cells and B cells was obtained in HCC patients with low-risk score. There is higher PD1&CTLA4 immunophenoscore and TMB score in low-risk score in HCC patients. Lower TIDE score and tumor escape score was found in HCC cases with low-risk score. The IC50 value of camptothecin, docetaxel, crizotinib, dasatinib, and erlotinib was lower in HCC cases with high-risk score. HCC patients with high-risk score had a higher score of cancer-related hallmarks, including angiogenesis, glycolysis, and NOTCH signaling. Our study proposed a novel VRS for HCC, which served as an indicator for predicting clinical outcome and immunotherapy responses in HCC.