A positive power-law relationship between the number of species in an area and the size of that area has been observed repeatedly in plant and animal communities. This species-area relationship, thought to be one of the few laws in ecology, is fundamental to our understanding of the distribution of global biodiversity. However, such a relationship has not been reported for bacteria, and little is known regarding the spatial distribution of bacteria, relative to what is known of plants and animals. Here we describe a taxa-area relationship for bacteria over a scale of centimetres to hundreds of metres in salt marsh sediments. We found that bacterial communities located close together were more similar in composition than communities located farther apart, and we used the decay of community similarity with distance to show that bacteria can exhibit a taxa-area relationship. This relationship was driven primarily by environmental heterogeneity rather than geographic distance or plant composition.