Social norms are a ubiquitous feature of social life and pervade almost every aspect of human social interaction. However, despite their importance, we still have relatively little empirical knowledge about the forces that drive the formation, the maintenance and the decay of social norms. In particular, our knowledge about how norms affect behavior and how norm obedience and violations shape subsequent normative standards is quite limited. Here, we present a new method that makes norms identifiable and continuously observable and, thus, empirically measurable. We show – in the context of public goods provision – the quick emergence of a widely accepted social cooperation norm that demands high contributions but – in the absence of the punishment of free-riders – norm violations are frequent and, therefore, the initial normative consensus as well as the high cooperation demands required by the norm break down. However, when peer punishment is possible, norm violations are rare from the beginning and a strong and stable normative consensus as well as high contribution requests prevail throughout. Thus, when norm compliance is costly social norms tend to unravel unless norm violations are kept to a minimum. In addition, our results indicate that – in an environment that has previously shown to be detrimental for cooperation and welfare – the opportunity to form a social norm unambiguously causes high public good contributions and group welfare when peer-punishment is possible.