A $k$-differential on a Riemann surface is a section of the $k$-th power of the canonical line bundle. Loci of $k$-differentials with prescribed number and multiplicities of zeros and poles form a natural stratification of the moduli space of $k$-differentials. In this paper we give a complete description for the compactification of the strata of $k$-differentials in terms of pointed stable $k$-differentials, for all $k$. The upshot is a global $k$-residue condition that can also be reformulated in terms of admissible covers of stable curves. Moreover, we study properties of $k$-differentials regarding their deformations, residues, and flat geometric structure.