Abstract Background Nicotinamide (NAM+) regulates redox and metabolic activities in the mitochondria. The intention of the research was to identify key genes that relate to nicotinamide in hepatocellular carcinoma (HCC). Methods Relevant clinical information were collected as well as RNA-seq data using the Cancer Genome Atlas (TCGA) database. Differential analysis was used to discover the genes that were differently expressed. On the key genes associated with NAM, functional enrichment analysis was carried out. Next, receiver operating characteristic (ROC) and prognosis Kaplan-Meier (K-M) curve analyses were used to evaluate the importance of important gene expression, respectively. The immune cell signatures were estimated using the CIBERSORT algorithm. Finally, the anticancer impact of NAM on HCC was experimentally confirmed, and important genes NADSYN1 and NT5C were validated at the protein level in clinical specimens. Results Six prognostic key genes (NAXE, NADSYN1, NT5C, NT5C3A, PNP and NT5E) were identified. There is an association between the level of key gene expression and the clinical prognosis. Four key genes (NAXE, NADSYN1, NT5C and NT5C3A) have statistical significance of survival prognosis. Finally, the expression of NAM-related genes and the inhibitory effect of NAM on HCC were verified by experiments. Conclusion The study first found some Nicotinamide metabolism-related differentially expressed genes (NMRDEGs) that are related to HCC can contribute to predicting survival and monitoring the treatment. Keywords: hepatocellular carcinoma, nicotinamide, bioinformatics analysis, diagnostic, prognostic Introduction The most frequent primary liver cancer is HCC, which also happens to be the sixth most common tumor. This malignancy has been gradually on the rise in terms of incidence and mortality in recent years. Numerous people continue to receive diagnoses of advanced-stage cancer with a wide range of symptoms, despite the significant improvements in cancer screening techniques.[40]^1 However, there are not many HCC patients who can benefit from successful therapy options. In order to improve all therapy approaches, it is vital that we explore more diagnostic biomarkers and potential therapeutic targets. The water-soluble vitamin B3 (niacin) has an amide form called NAM, which is more frequently found in foods like meat, fish, beans, mushrooms, nuts, and cereals. By use of the enzyme nicotinamide phosphate ribosyl transferase (NAMPT), NAM is directly transformed in living cells into nicotinamide mononucleotide (NMN), which subsequently binds to ATP to create nicotinamide adenine dinucleotide (NAD^+). NAM, the fundamental component of cellular energy metabolism, is crucial for the formation of NAD^+.[41]^2 Cancer is characterized by metabolic dysregulation, which promotes unregulated cancer growth.[42]^3 NAM is therefore thought to impact tumor growth through modifying cell metabolism. Based on the TCGA and GeneCards datasets, this study intended to locate nicotinamide-related genes in HCC and then confirmed the expression of these genes in multiple datasets acquired from the GEO database. Using the CIBERSORT approach, the link between niacinamide expression level and immune cell infiltration was investigated. The drug sensitivity investigation of NAM major genes related with HCC used the Genomics of Cancer Cell Line Encyclopedia (CCLE), Drug Sensitivity in Cancer (GDSC), and CellMiner databases. Our research identifies a trustworthy and feasible treatment target for HCC. Materials and Methods Data Acquisition The Liver Hepatocellular Carcinoma (LIHC) dataset was downloaded from TCGA database ([43]https://portal.gdc.cancer.gov/).[44]^4 374 cases of liver cancer samples (grouping: LIHC) and 50 cases of paracancerous samples (grouping: Normal) were got from the UCSC Xena database ([45]http://genome.ucsc.edu).[46]^5 The limma package was performed to normalize the count sequencing data of the TCGA-LIHC data set.[47]^6 Using tool GEOquery, the LIHC-related datasets [48]GSE25097, [49]GSE46408 and [50]GSE84402[51]^7 were obtained.[52]^7–11 The probe names of the datasets were annotated using the pertinent GPL platform files ([53]supplementary Table S1). Identification of Nicotinamide Metabolism-Related Genes (NMRGs) Forty-two NMRGs were acquired from related references, and eight NMRGs