[Aim] The Trogoderma granarium is an important quarantine pest, found in many counties in Xinjiang. It was intercepted many times by port quarantine officers. [Method] The study was carried out using the T. granarium's 16S rDNA gene as target fragments. The universal insect primer was used amplify DNA from the four Trogoderma spp.. T. granarium's specific primers and probes were designed by using biological software. [Result] The designed primers TG-SNP-F/TG-SNP-R could specifically detect the T. granarium by conventional PCR. The amplified fragment was 250 bp, and its sensitivity was 3 ng·μL-1. Real-time PCR methods of detecting the T. granarium had strong specificity, with sensitivity of 0.8 fg·μL-1. [Conclusion] T. granarium was accurately identified by using the conventional as well as real-time PCR, and provides technical support for port quarantine officers to detect T. granarium in imported goods.