  We prove a spectral inequality for the Landau operator. This means that for
all $f$ in the spectral subspace corresponding to energies up to $E$, the
$L^2$-integral over suitable $S \subset \mathbb{R}^2$ can be lower bounded by
an explicit constant times the $L^2$-norm of $f$ itself. We identify the class
of all measurable sets $S \subset \mathbb{R}^2$ for which such an inequality
can hold, namely so-called thick or relatively dense sets, and deduce an
asymptotically optimal expression for the constant in terms of the energy, the
magnetic field strength and in terms of parameters determining the thick set
$S$. Our proofs rely on so-called magnetic Bernstein inequalities. As a
consequence, we obtain the first proof of null-controllability for the magnetic
heat equation (with sharp bound on the control cost), and can relax assumptions
in existing proofs of Anderson localization in the continuum alloy-type model.
