Access to efficient enzymes that can convert A and B type red blood cells to 'universal' donor O would greatly increase the supply of blood for transfusions. Here we report the functional metagenomic screening of the human gut microbiome for enzymes that can remove the cognate A and B type sugar antigens. Among the genes encoded in our library of 19,500 expressed fosmids bearing gut bacterial DNA, we identify an enzyme pair from the obligate anaerobe Flavonifractor plautii that work in concert to efficiently convert the A antigen to the H antigen of O type blood, via a galactosamine intermediate. The X-ray structure of the N-acetylgalactosamine deacetylase reveals the active site and mechanism of the founding member of an esterase family. The galactosaminidase expands activities within the CAZy family GH36. Their ability to completely convert A to O of the same rhesus type at very low enzyme concentrations in whole blood will simplify their incorporation into blood transfusion practice, broadening blood supply.