Microbial biofilms are ubiquitous in aquatic environments where they provide important ecosystem functions. A key property believed to influence the community structure and function of biofilms is thickness. However, since biofilm thickness is inextricably linked to external factors such as water flow, temperature, development age and nutrient conditions, its importance is difficult to quantify. Here, we designed an experimental system in a wastewater treatment plant whereby nitrifying biofilms with different thicknesses (50 or 400 µm) were grown in a single reactor, and thus subjected to identical external conditions. The 50 and 400 µm biofilm communities were significantly different. This beta-diversity between biofilms of different thickness was primarily caused by deterministic factors. Turnover (species replacement) contributed more than nestedness (species loss) to the beta-diversity, i.e. the 50 µm communities were not simply a subset of the 400 µm communities. Moreover, the two communities differed in the composition of nitrogen-transforming bacteria and in nitrogen transformation rates. The study illustrates that biofilm thickness alone is a key driver for community composition and ecosystem function, which has implications for biotechnological applications and for our general understanding of biofilm ecology.