Primary liver cancer is a rapidly progressing neoplasm with high morbidity and mortality rates. The present study aimed to identify potential diagnostic and prognostic biomarkers, and candidate targeted agents for hepatitis B virus (HBV)-associated early stage hepatocellular carcinoma (HCC). The gene expression profiles were extracted from the Gene Expression Omnibus database. Differentially expressed genes (DEGs), hub genes and the enrichment of signaling pathways were filtered out via a high-throughput sequencing method. The association between hub genes and the effects of the abnormal expression of hub genes on the rate of genetic variation, overall survival (OS), relapse-free survival (RFS), progression-free survival (PFS) and disease-free survival (DSS) of patients with HCC, as well as pathological stage and grade, were analyzed using different databases. A total of 1,582 DEGs were identified. Gene Ontology analysis revealed that the DEGs were mainly involved in the 'oxidation-reduction process', 'steroid metabolic process', 'metabolic process' and 'fatty acid beta-oxidation'. Enrichment analysis of Kyoto Encyclopedia of Genes and Genomes pathways revealed that the DEGs were mainly associated with 'metabolic pathways', 'PPAR signaling pathway', 'fatty acid degradation' and the 'cell cycle'. A total of 8 hub genes were extracted. Additionally, the abnormal expression levels of hub genes were closely associated with the OS, RFS, PFS and DSS of patients, the pathological stage and the grade. Furthermore, abnormal expression levels of the 8 hub genes were found in >30% of all samples. Several small molecular compounds that may reverse the altered DEGs were identified based on Connectivity Map analysis, including phenoxybenzamine, GW-8510, resveratrol, 0175029-0000 and daunorubicin. In conclusion, the dysfunction of fat metabolic pathways, the cell cycle, oxidation-reduction processes and viral carcinogenesis may serve critical roles in the occurrence of HBV-associated early stage HCC. The identified 8 hub genes may act as robust biomarkers for diagnosis and prognosis. Some small molecular compounds may be promising targeted agents against HBV-associated early stage HCC.