Nasopharyngeal carcinoma (NPC) is a common head and neck cancer with a poor prognosis. There is an urgent need to develop a simple and convenient screening tool for early detection and risk screening of NPC. 139 microbial samples were collected from 40 healthy people and 39 patients with nasopharyngeal biopsy. A total of 40 and 39 oral, eight and 27 nasal cavity, nine and 16 nasopharyngeal microbial samples were collected from the two sets of individuals. A risk screening tool for NPC was established by 16S rDNA sequencing and random forest. Patients with nasopharyngeal biopsy had significantly lower nasal cavity and nasopharynx microbial diversities than healthy people. The beta diversity of the oral microbiome was significantly different between the two groups. The NPC screening tools based on nasopharyngeal and oral microbiomes have 88% and 77.2% accuracies, respectively. The nasopharyngeal biopsy patients had significantly higher Granulicatella abundance in their oral cavity and lower Pseudomonas and Acinetobacter in the nasopharynx than healthy people. This study established microbiome-based non-invasive, simple, no radiation, and low-cost NPC screening tools. Individuals at a high risk of NPC should be advised to seek further examination, which might improve the early detection of NPC and save public health costs.