Phytase supplementation in broiler diets is a common practice to improve phosphorus (P) availability and to reduce P loss by excretion. An enhanced P availability, and its concomitant supplementation with calcium (Ca), can affect the structure of the microbial community in the digestive tract of broiler chickens. Here, we aim to distinguish the effects of mineral P, Ca, and phytase on the composition of microbial communities present in the content and the mucosa layer of the gastrointestinal tract (GIT) of broiler chickens.Significant differences were observed between digesta and mucosa samples for the GIT sections studied (p = 0.001). The analyses of 56 individual birds showed a high microbial composition variability within the replicates of the same diet. The average similarity within replicates of digesta and mucosa samples across all diets ranged from 29 to 82% in crop, 19–49% in ileum, and 17–39% in caeca. Broilers fed with a diet only supplemented with Ca had the lowest body weight gain and feed conversion values while diets supplemented with P showed the best performance results. An effect of each diet on crop mucosa samples was observed, however, similar results were not obtained from digesta samples. Microbial communities colonizing the ileum mucosa samples were affected by P supplementation. Caeca-derived samples showed the highest microbial diversity when compared to the other GIT sections and the most prominent phylotypes were related to genus Faecalibacterium and Pseudoflavonifractor, known for their influence on gut health and as butyrate producers. Lower microbial diversity in crop digesta was linked to lower growth performance of birds fed with a diet only supplemented with Ca. Each diet affected microbial communities within individual sections, however, no diet showed a comprehensive effect across all GIT sections, which can primarily be attributed to the great variability among replicates. The substantial community differences between digesta and mucosa derived samples indicate that both habitats have to be considered when the influence of diet on the gut microbiota, broiler growth performance, and animal health is investigated.