BackgroundStable reference genes are essential for accurate normalization in gene expression studies with reverse transcription quantitative polymerase chain reaction (qPCR). A synanthropic fly, Chrysomya megacephala, is a well known medical vector and forensic indicator. Unfortunately, previous studies did not look at the stability of reference genes used in C. megacephala.ResultsIn this study, the expression level of Actin, ribosomal protein L8 (Rpl8), glyceraldehyde-3-phosphate dehydrogenase (GAPDH), elongation factor 1α (EF1), α-tubulin (α-TUB), β-tubulin (β-TUB), TATA binding box (TBP), 18S rRNA (18S) and ribosomal protein S7 (Rps7) were evaluated for their stability using online software RefFinder, which combines the normal software of the ΔCt method, BestKeeper, Normfinder, and geNorm. Moreover the number of suitable reference gene pairs was also suggested by Excel-based geNorm. The expression levels of these reference genes were evaluated under different experimental conditions with special perspectives of forensic applications: developmental stages (eggs, first, second and third instar larvae, pupae and adults); food sources of larvae (pork, fish and chicken); feeding larvae with drugs (untreated control, Estazolam and Marvelon); feeding larvae with heavy metals (untreated control, cadmium and zinc); tissues of adults (head, thorax, abdomen, legs and wings). According to RefFinder, EF1 was the most suitable reference gene of developmental stages, food and tissues; 18S and GAPDH were the most suitable reference genes for drugs and heavy metals, respectively, which could be widely used for quantification of target gene expression with qPCR in C. megacephala. Suitable reference gene pairs were also suggested by geNorm.ConclusionThis fundamental but vital work should facilitate the gene studies of related biological processes and deepen the understanding in physiology, toxicology, and especially medical and forensic entomology of C. megacephala.Electronic supplementary materialThe online version of this article (doi:10.1186/s13071-015-1175-9) contains supplementary material, which is available to authorized users.