Purpose Nasopharyngeal cancer is a type of malignancy originating from the epithelial cells lining the nasopharynx. In genetic and environmental factors, infection with Epstein-Barr virus is one of the particular factors held accountable for the etiopathogenesis. Human papillomavirus has been associated with cervical, anogenital, and oropharyngeal cancers. The aim of the present study is to demonstrate the presence and incidence of Epstein-Barr virus and human papillomavirus in patients with nasopharyngeal cancer. Methods The information collected for these patients included age at the time of biopsy, gender, alcohol consumption and smoking, and histopathological type of nasopharyngeal cancer. Only patients for whom nasopharyngeal biopsy was performed as punch biopsy were included in the study. In situ hybridization was performed with formalin-fixed, paraffin-embedded tissue sections for Human Papillomavirus and Epstein-Barr virus nucleic acids obtained by means of automated Ventana BenchMark Medical system Results Utilizing in situ hybridization with samples obtained from 56 patients diagnosed with nasopharyngeal cancer. Epstein-Barr virus was positive in 41 out of the 56 (73.2%) patients, while human papillomavirus was positive in 3 (5.4%), and 1 patient (1.8%) had co-infection. Thirty seven (90.2%) of the 41 patients positive for Epstein-Barr virus were Type-2 according to WHO, while 4 (9.8%) were Type-1. All three patients (100%) with Human Papillomavirus positivity were Type-2 according to WHO. Conclusions This study shows the close association between nasopharyngeal cancer and Epstein-Barr virus whereas such an association is not shown for Human Papillomavirus.