In conclusion, this study revealed that RAB42 expression was associated with multiple clinical characteristics, meanwhile, its expression and methylation status correlated with immune cells infiltration and the prognosis of HCC. This evidence concerns the gene RAB42 and hepatocellular carcinoma.