With the completion of genome sequencing of the black soldier fly (BSF), an increasing number of researchers are focusing on elucidating its robust digestive and absorptive capabilities through genetic and molecular biology methods to enhance its growth performance. However, most genetic and molecular biology studies require gene expression analysis, and the stability of reference genes may change under different experimental conditions. To identify optimal reference genes, we evaluated 11 candidate reference genes (GAPDH, beta-actin, GST, Tubulin alpha-1A, Tubulin alpha-4A, Tubulin beta, RP49, RPL13, EF1-alpha, 18S RNA, and 28S RNA) across various developmental stages, tissues, sexes, and 3 distinct genotypes of Hermetia illucens using RefFinder software, which integrates the statistical algorithms geNorm, NormFinder, BestKeeper, and Delta Ct. The results recommend that beta-Actin, 18S RNA, and RPL13 are suitable for analyzing different developmental stages; RPL13, GST, and RP49 are optimal for different tissues; EF1, RPL13, and GST work best for different sexes; and RPL13, GAPDH, and 18S RNA are ideal for different genotypes. Notably, this study is the first to evaluate the stability of reference genes across 3 BSF genotypes originating from different regions. The findings offer valuable references and fresh insights for molecular biology research on H. illucens.