The Church of Denmark was established in 1849 and is regarded as a pillar of traditional national identity. This status is being challenged by a steady decline in membership in recent decades. The Capital area is especially prone to low membership rates, and this regional pattern remains when the analysis controls for income and education. Furthermore, the local membership rate is also related to affiliation to the neighbourhood. Our detailed analysis is based on public register data on the individual level combined with geographical mapping information. Denmark is thereby divided into micro-aggregated areas in order to locate varying church membership rates. While some local variation can be explained by socioeconomic status, some also depend on residential belonging to different types of local communities. Our analysis points to the sense of attachment to place of residence as a major factor in explaining membership of the established church.