Periodic magnetic structures, i.e., undulators and wigglers, have been used for nearly 40 years as sources of brilliant synchrotron radiation. Today, sophisticated undulator designs provide many degrees of freedom such as photon beam energy, variable polarization, and orbital angular momentum. Specific designs efficiently suppress higher orders or reduce the on-axis power density. All tuning parameters are required to be freely accessible by the users. Still, the majority of undulators is based on permanent magnets with a clear trend to short periods and in-vacuum and cryogenically cooled systems. Similar designs are used for storage rings and free electron lasers, though the field quality requirements are different. Today, the optimization of a specific experiment follows a global approach. This includes not only the undulator design itself but also local lattice modifications to cope with ambitious designs, elaborate tracking schemes to estimate the impact on the dynamic aperture, and last but not least radiation propagation tools which transport a realistic photon beam phase space to the sample. This chapter summarizes the theory of undulator radiation and reviews the technological realization of undulators and wigglers. Operational issues are discussed, as well.