A major challenge in diagnostic pathology is to identify sensitive and specific markers for tumor origin. Although PAX8 is the most widely used marker for gynecological tumors, it is not entirely specific, which makes it difficult to determine the origin of some tumors with high confidence. Through mining The Cancer Genome Atlas mRNA expression profile data, we identified SOX17 as a potential specific marker at the mRNA level for gynecological tumors. To test SOX17 expression at the protein level, we performed immunochemical staining in a large cohort of ovarian and endometrial cancer cases (n = 402) together with a large cohort of solid tumors from other organs (n = 1269). Similar to PAX8, SOX17 was highly expressed in all subtypes of ovarian carcinoma (97.5% for SOX17 vs. 97% for PAX8 in serous, 90% vs. 90% in endometrioid, and 100% vs. 100% in clear cell and transitional cell types) except for mucinous carcinoma (0% vs 27%), and also highly expressed in endometrial endometrioid carcinoma (88% vs 84%). However, SOX17 was completely negative in thyroid carcinoma and renal cell carcinoma, whereas PAX8 expression was high (86% and 85%, respectively). In addition, SOX17 had no expression in breast carcinoma, lung carcinoma, pancreatic adenocarcinoma, colonic and gastric adenocarcinomas, salivary ductal carcinoma, hepatocellular carcinoma, and cholangiocarcinoma. Our data indicate that SOX17 is not only a sensitive but also a specific marker for the origin of ovarian and endometrial carcinomas.