Background: Age was important prognostic factors for operable hepatocellular carcinoma patients. The aim of the present study was to assess the difference in gut microbiota in patients with operable hepatitis B virus-related hepatocellular carcinoma (HBV-HCC) at different ages ; to investigate the features of the microbiota and its function associated with different ages; to provide a preliminary look at effects of the gut microbiota dimension on prognostic.Methods: From September 2020 to May 2021, patients with HBV-HCC were able to undergo liver resection and were recruited consecutively and divided into the younger age group (age <45 years) (Y.AG) (n=20), middle age group (age from 45 to 65 years) (M.AG) (n=13) 45-65 years, and older age group (age >65 years) (O.AG) (n=20). The relationships between gut microbiota and different ages were explored using 16S rRNA gene sequencing data. PICRUST2 was used to examine the metagenomic data in PHLF patients.Fisher's exact and Mann-Whitney U-test were used for the data analysis.Results: Pairwise comparison between the three groups showed that the α-diversity of Y.AG was significantly higher than that of O.AG (ACE Index, P=0.017; chao1 Index, P=0.031; observed_species Index, P=0.011; and goods_coverage Index, P=0.041). The β-diversity in the 3 groups differed significantly (stress =0.100), while the composition (β-diversity) differed significantly between the Y.AG and the M.AG (stress =0.090), the M.AG and the O.AG (stress =0.095), and the Y.AG and the O.AG (stress =0.099). At the genus level, 7 bacterial genera were significantly enriched in the O.AG compared with the Y.AG, of which Streptococcus, Blautia, Erysipelotrichaceae_UCG-003, and Fusicatenibacter represented the major variances in O.AG microbiomes. Eleven genera were significantly increased in the O.AG, of which Prevotella, Allorhizobium-Neorhizobium-Pararhizobium-Rhizobium, Ruminiclostridium, and Phascolarctobacterium represented the major variances in the O.AG. The Y.AG and the O.AG were predicted by PICRUSt2 analysis, which found 72 pathways related to differential gut microbiome at the genus level. Redundancy analysis showed that 7 environmental factors were significantly correlated with intestinal microorganisms, especially in the Y.AG compared with the O.AG. Conclusions: Analysis of gut microbiota characteristics in patients of different ages could ultimately contribute to the development of novel avenues for the treatment of HCC at different ages.