We show how, for all dimensions and signatures, the most general first-order linear symmetry operator for the massive Dirac equation is given in terms of Killing–Yano tensors. In the massless case the Killing–Yano condition is relaxed to the conformal Killing–Yano generalization.