In simply-connected Euclidean domains, it is well-known that the topological complexity of a given magnetic field can be quantified by its magnetic helicity, which is equivalent to the total, flux-weighted winding number of magnetic field lines. Often considered in analytical and numerical studies are domains periodic in two lateral dimensions (periodic domains) which are multiply-connected and homeomorphic to a 2-torus. Whether this equivalence can be generalised to periodic domains remains an open question, first posed by Berger (Berger 1996 J. Geophys. Res. 102, 2637-2644 (doi:10.1029/96JA01896)). In this particle, we answer in the affirmative by defining the novel periodic winding of curves and identifying a vector potential that recovers the topological interpretation of magnetic helicity as winding. Key properties of the topologically defined magnetic helicity in periodic domains are also proved, including its time-conservation in ideal magnetohydrodynamical flows, its connection to Fourier approaches, and its relationship to gauge transformations.