Cytochrome P450 Family 1 Subfamily B Member 1 (CYP1B1) is a critical metabolic enzyme of melatonin. Although melatonin has been identified to exhibit tumor suppressing activity, the role and mechanism of the clinical and immunological characteristics of CYP1B1 in cancer remain unclear. In this study, RNA expression and clinical data were obtained from The Cancer Genome Atlas (TCGA) across 33 solid tumors. The expression, survival, immune subtype, molecular subtype, tumor mutation burden (TMB), microsatellite instability (MSI), biological pathways, and function in vitro and vivo were evaluated. The predictive value of CYP1B1 in immune cohorts was further explored. We found the dysregulated expression of CYP1B1 was associated with the clinical stage and tumor grade. Immunological correlation analysis showed CYP1B1 was positively correlated with the infiltration of lymphocyte, immunomodulator, chemokine, receptor, and cancer-associated fibroblasts (CAFs) in most cancer. Meanwhile, CYP1B1 was involved in immune subtype and molecular subtype, and was connected with TMB, MSI, neoantigen, the activation of multiple melatonergic and immune-related pathways, and therapeutic resistance. Together, this study comprehensively revealed the role and mechanism of CYP1B1 and explored the significant association between CYP1B1 expression and immune activity. These findings provide a promising predictor and molecular target for clinical immune treatment.