Nonalcoholic fatty liver disease (NAFLD) is the most common chronic liver disease in children and adolescents. The gut microbiota plays an important role in the pathophysiology of NAFLD through the gut–liver axis. Therefore, we aimed to investigate the genus and species of gut microbiota and their functions in children and adolescents with NAFLD. From May 2017 to July 2018, a total of 58 children and adolescents, including 27 abnormal weight (AW) (obese) NAFLD patients, 16 AW non-NAFLD children, and 15 healthy children, were enrolled in this study at Shenzhen Children’s Hospital. All of them underwent magnetic resonance spectroscopy (MRS) to quantify the liver fat fraction. Stool samples were collected and analysed with metagenomics. According to body mass index (BMI) and MRS proton density fat fraction (MRS-PDFF), we divided the participants into BMI groups, including the AW group (n = 43) and the Lean group (n = 15); MRS groups, including the NAFLD group (n = 27) and the Control group (n = 31); and BMI-MRS 3 groups, including NAFLD_AW (AW children with NAFLD) (n = 27), Ctrl_AW (n = 16) (AW children without NAFLD) and Ctrl_Lean (n = 15). There was no difference in sex or age among those groups (p > 0.05). In the BMI groups, at the genus level, Dialister, Akkermansia, Odoribacter, and Alistipes exhibited a significant decrease in AW children compared with the Lean group. At the species level, Megamonas hypermegale was increased in the AW group, while Akkermansia muciniphila, Dialister invisus, Alistipes putredinis, Bacteroides massiliensis, Odoribacter splanchnicus, and Bacteroides thetaiotaomicron were decreased in AW children, compared to the Lean group. Compared with the Control group, the genus Megamonas, the species of Megamonas hypermegale and Megamonas rupellensis, increased in the NAFLD group. Furthermore, the genus Megamonas was enriched in the NAFLD_AW group, while Odoribacter, Alistipes, Dialister, and Akkermansia were depleted compared with the Ctrl_Lean or Ctrl_AW group at the genus level. Megamonas hypermegale and Megamonas rupellensis exhibited a significant increase in NAFLD_AW children compared with the Ctrl_Lean or Ctrl_AW group at the species level. Compared with healthy children, the pathways of P461-PWY contributed by the genus Megamonas were significantly increased in NAFLD_AW. We found that compared to healthy children, the genus Megamonas was enriched, while Megamonas hypermegale and Megamonas rupellensis were enriched at the species level in children and adolescents with NAFLD. This indicates that the NAFLD status and/or diet associated with NAFLD patients might lead to the enrichment of the genus Megamonas or Megamonas species.