Plant species differ in their ecological amplitude, with some species occurring in very different habitats under strongly differentiated environmental conditions. We were interested in to what extent the occurrence of Linum catharticum in dry calcareous grasslands (Bromion) and wet litter meadows (Molinion), two habitats on opposing ends concerning, for example, moisture level, is reflected on the genetic and epigenetic level. Using AFLP (amplified fragment length polymorphisms) and MSAP (methylation sensitive amplification polymorphisms) analyses, we studied the genetic and epigenetic variation of L. catharticum from calcareous grasslands and litter meadows. From each habitat, we included five study sites with 16 individuals per sampling location. We observed lower genetic than epigenetic diversity, but considerable differentiation among habitats, which was stronger on the genetic than the epigenetic level. Additionally, we observed a strong correlation of genetic and epigenetic distance, irrespective of geographic distance. The dataset included a large portion of fragments exclusively found in individuals from one or the other habitat. Some epigenetic fragments even occurred in different methylation states depending on the habitat. We conclude that environmental effects act on both the genetic and epigenetic level, producing the clear differentiation among plant individuals from calcareous grasslands and litter meadows. These results may also point into the direction of ecotype formation in this species.