Ammonia is emitted from compost piles with inherent spatial heterogeneity, while adjusting carbon to nitrogen (C/N) ratios can mitigate ammonia emissions. However, the role of spatial heterogeneity in composting bacterial communities mediating nitrogen conversion remains unclear. This study explored bacterial spatial heterogeneity at different locations in piles and its links to ammonia emission during chicken manure composting under increased C/N ratios. Compared with manure-only composting (C/N ratio 7), composting under increased C/N ratios of 16 reduced ammonia emissions by 57.60 % and 22.62 % by adding pine wood and peanut shell, respectively. Meanwhile, significant spatial variations in Sobs, Shannon, and node numbers (P < 0.05) during manure-only composting became insignificant due to C/N ratio increases. Null model and neutral community model showed that stochasticity strongly drove community assembly in all treatments. Assembly process balancing became spatially consistent under increased C/N ratios, shaping the corresponding reduced spatial heterogeneity in alpha-diversity and networks. The variation patterns of spatial heterogeneity in Sobs, node numbers, and dispersal limitation ratios were similar to that of cumulative ammonia emission decreasing with increasing C/N ratio. Additionally, cumulative ammonia emission was positively associated with spatial heterogeneity in Sobs (R2 = 0.49, P < 0.05) and dispersal limitation ratios (R2 = 0.53, P < 0.05), while the heterogeneity explained 60.33 % of ammonia variations. This study demonstrated that reduced bacterial spatial heterogeneity was associated with ammonia emission reductions under increased C/N ratios. The improved understanding of bacterial spatial heterogeneity during composting will provide a new perspective for indicating and regulating ammonia emissions.