Accurate detection of circulating tumor DNA (ctDNA) has the potential to guide personalized cancer therapy. DNA viruses such as Epstein-Barr virus (EBV) and human papillomavirus (HPV) are major oncologic drivers of nasopharyngeal cancer (NPC) and cervical cancer (CC), respectively, and provide a convenient etiological marker for measurement of ctDNA. Polymerase chain reaction (PCR)-based methods have been widely studied, but more accurate tests are needed. We hypothesized that a next generation sequencing (NGS) approach could outperform PCR-based methods for viral ctDNA detection. We developed a novel NGS method for viral ctDNA detection. Viral genome sequencing for EBV (EBV-seq) or HPV (HPV-seq) was achieved by hybrid capture NGS. Unique molecular identifiers were incorporated for accurate copy number quantification. We implemented a custom bioinformatics workflow to (1) quantify viral sequences, (2) report viral subtype, and (3) measure ctDNA fragment length. The lower limit of detection (LLOD) was compared with published PCR-based methods in cell line dilution series. To test performance on clinical samples, we applied EBV-seq to a cohort of 19 newly diagnosed EBV-associated NPC patients for whom the clinical EBV quantitative PCR test had provided a false negative result and to a control cohort of 20 healthy volunteers. We applied HPV-seq to 40 plasma samples from a cohort of 18 CC patients treated with chemoradiotherapy and to a control cohort of 5 healthy volunteers. The LLOD of EBV-Seq was ≤0.01 EBV genome-equivalents (GE), 100X lower than quantitative PCR. The LLOD of HPV-seq was ≤0.2 HPV GE, 10X lower than digital PCR. For EBV-seq, 19/19 NPC patients had detectable ctDNA (sensitivity=100%, range=0.08-141 EBV GE); 10/20 controls had detectable ctDNA (specificity=50%, range=0.02-0.71 EBV GE). 17/19 (89%) patients, including 6/6 with stage I-II disease, had EBV-seq levels that were >20X above the highest level seen in the control cohort (i.e., 89% sensitivity with 100% specificity). For HPV-seq, 6/6 baseline CC samples, 10/17 (59%) end-of-treatment samples, 1/14 (7%) 3-month post-treatment samples, and 3/3 samples taken upon recurrence had positive HPV-seq results (sensitivity=100%, range=0.02-559 HPV GE) that were highly correlated with digital PCR (Pearson R=0.97) but with 60X higher signal than digital PCR; 0/5 controls had detectable ctDNA (specificity=100%). EBV-seq and HPV-seq were able to report viral subtype in 49/49 positive samples. Viral ctDNA was consistently shorter than non-cancer-derived plasma DNA (median difference=15bp). For DNA virus-associated cancers, viral genome NGS provides dramatically greater sensitivity than PCR-based methods and enables viral subtyping and ctDNA fragment length analysis. Further evaluation is warranted to test the clinical utility of ultrasensitive ctDNA detection using this approach.