  For any quantum system invariant under gauging a higher-form global symmetry,
we construct a non-invertible topological defect by gauging in only half of
spacetime. This generalizes the Kramers-Wannier duality line in 1+1 dimensions
to higher spacetime dimensions. We focus on the case of a one-form symmetry in
3+1 dimensions, and determine the fusion rule. From a direct analysis of
one-form symmetry protected topological phases, we show that the existence of
certain kinds of duality defects is intrinsically incompatible with a trivially
gapped phase. We give an explicit realization of this duality defect in the
free Maxwell theory, both in the continuum and in a modified Villain lattice
model. The duality defect is realized by a Chern-Simons coupling between the
gauge fields from the two sides. We further construct the duality defect in
non-abelian gauge theories and the $\mathbb{Z}_N$ lattice gauge theory.
