Cell-free DNA (cfDNA) in the blood is a less-invasive tool to reveal genomic profiles in pancreatic and bile tract cancers (PC and BTC); however, its utility is limited owing to its small amount and fragmentation of DNA for integrated sequences. This study evaluated the quality of in bile juice to clarify the potential of genome profiling for precision treatment. We collected data from 13 patients with pancreatic-biliary tumors invading the bile duct and subsequently underwent surgical resection: 7 cholangiocarcinomas, 1 gallbladder carcinoma, 3 ampullary carcinomas, 1 pancreatic cancer, and 1 intraductal papillary mucinous carcinoma. Whole-exome sequencing-based extracted DNA from resected samples revealed pathogenic alterations of TP53, ABCA8, BRCA2, FGFR2, APC, SMAD4 and NRAS. Of the 13 patients, nine pairs of cfDNA from bile and plasma were analyzed. Bile contained more (and longer fragments) cfDNAs compared with plasma. The most representative alterations in TP53, KRAS, PIK3CA, BRAF and NRAS were detected in bile cfDNA. Thus, bile cfDNA indicated better quality and quantity for sequence analysis and reflected tumor-derived genetic variation. Bile cfDNA is a useful tool for liquid biopsy in genomic profiling and precision medicine.