BACKGROUND & AIMS:To influence host and disease phenotype, compositional microbiome changes, which have been demonstrated in patients with primary sclerosing cholangitis (PSC), must be accompanied by functional changes. We therefore aimed to characterize the genetic potential of the gut microbiome in patients with PSC compared with healthy controls (HCs) and patients with inflammatory bowel disease (IBD). METHODS: Fecal DNA from 2 cohorts (1 Norwegian and 1 German), in total comprising 136 patients with PSC (58% with IBD), 158 HCs, and 93 patients with IBD without PSC, were subjected to metagenomic shotgun sequencing, generating 17 billion pairedend sequences, which were processed using HUMAnN2 and MetaPhlAn2, and analyzed using generalized linear models and random effects meta-analyses. RESULTS: Patients with PSC had fewer microbial genes compared with HCs (P < .0001). Compared with HCs, patients with PSC showed enrichment and increased prevalence of Clostridium species and a depletion of, for example, Eubacterium spp and Ruminococcus obeum. Patients with PSC showed marked differences in the abundance of genes related to vitamin B6 synthesis and branched-chain amino acid synthesis (Q fdr < .05). Targeted metabolomics of plasma from an independent set of patients with PSC and controls found reduced concentrations of vitamin B6 and branched-chain amino acids in PSC (P < .0001), which strongly associated with reduced liver transplantation-free survival (log-rank P < .001). No taxonomic or functional differences were detected between patients with PSC with and without IBD. CONCLUSIONS: The gut microbiome in patients with PSC exhibits large functional differences compared with that in HCs, including microbial metabolism of essential nutrients. Alterations in related circulating metabolites associated with disease course, suggesting that microbial functions may be relevant for the disease process in PSC.