Tumors of unknown origin (TUO) generally result in poor patient survival and are clinically difficult to address. Identification of the site of origin in TUO patients is paramount to their improved treatment and survival but is difficult to obtain with current methods. Here, we develop a random forest machine learning TUO methylation classifier using a large number of primary and metastatic tumor samples. Our classifier achieves high accuracy in primary site identification when applied to both publicly available and internal validation samples, with 97% of samples classified correctly and 85% receiving high probability scores (≥ 0.9). Moreover, by employing pathologist expertise and unsupervised clustering, the TUO classifier can assign samples to 46 different site of origin/disease classes. This strategy also revealed multiple classes of yet unknown significance for future exploration. Overall, the presented TUO classifier represents a significant step forward in the diagnosis of TUO tumors.