Microbial biofilms show high phenotypic and genetic diversity, yet the mechanisms underlying diversity generation and maintenance remain unclear. Here, we investigate how spatial patterns of growth activity within a biofilm lead to spatial patterns of genetic diversity. Using individual-based computer simulations, we show that the active layer of growing cells at the biofilm interface controls the distribution of lineages within the biofilm, and therefore the patterns of standing and de novo diversity. Comparing biofilms of equal size, those with a thick active layer retain more standing diversity, while de novo diversity is more evenly distributed within the biofilm. In contrast, equal-sized biofilms with a thin active layer retain less standing diversity, and their de novo diversity is concentrated at the top of the biofilm, and in fewer lineages. In the context of antimicrobial resistance, biofilms with a thin active layer may be more prone to generate lineages with multiple resistance mutations, and to seed new resistant biofilms via sloughing of resistant cells from the upper layers. Our study reveals fundamental “baseline” mechanisms underlying the patterning of diversity within biofilms.