Human gut microbiota directly influences health and provides an extra means of adaptive potential to different lifestyles. To explore variation in gut microbiota and to understand how these bacteria may have co-evolved with humans, here we investigate the phylogenetic diversity and metabolite production of the gut microbiota from a community of human hunter-gatherers, the Hadza of Tanzania. We show that the Hadza have higher levels of microbial richness and biodiversity than Italian urban controls. Further comparisons with two rural farming African groups illustrate other features unique to Hadza that can be linked to a foraging lifestyle. These include absence of Bifidobacterium and differences in microbial composition between the sexes that probably reflect sexual division of labour. Furthermore, enrichment in Prevotella, Treponema and unclassified Bacteroidetes, as well as a peculiar arrangement of Clostridiales taxa, may enhance the Hadza's ability to digest and extract valuable nutrition from fibrous plant foods.