This study aimed to expand our understanding of metformin (Met) in inhibiting hepatocellular carcinoma (HCC) progression and to investigate its underlying mechanism. Met was administrated to HCC cells at 5, 10, and 20 μM, after which the cell phenotype was evaluated. RNA-seq cluster analysis was used to screen for target genes modulated by Met. Luciferase activity and ChIP assays were performed to detect the effect of FOXO3 on the transcriptional activation of NLRP3. We evaluated the effect of Met and FOXO3 and on the growth of HCC cells in vivo. Met inhibited HCC cell proliferation and promoted apoptosis. Met also induced pyroptosis of HCC cells. FOXO3 was significantly upregulated by Met treatment, and FOXO3 activated transcription of NLRP3. Cells after Met treatment together with FOXO3 knockdown have a stronger colony formation and migration ability but a lower apoptosis rate compared to the Met treatment alone group. In vivo, Met inhibited HCC tumor growth. The tumors in Met treatment and FOXO3 knockdown group grew faster than in Met treatment group. Thus, Met attenuates HCC cell development by inducing apoptosis and pyroptosis. This effect of metformin is partially dependent on FOXO3 which can activate the transcription of NLRP3.