We show that the supersymmetry transformations for type II string theories on six-manifolds can be written as differential conditions on a pair of pure spinors, the exponentiated Kähler form e iJ and the holomorphic form Ω. The equations are explicitly symmetric under exchange of the two pure spinors and a choice of even or odd-rank RR field. This is mirror symmetry for manifolds with torsion. Moreover, RR fluxes affect only one of the two equations: e iJ is closed under the action of the twisted exterior derivative in IIA theory, and similarly Ω is closed in IIB. Modulo a different action of the B-field, this means that supersymmetric SU(3)-structure manifolds are all generalized Calabi-Yau manifolds, as defined by Hitchin. An equivalent, and somewhat more conventional, description is given as a set of relations between the components of intrinsic torsions modified by the NS flux and the Clifford products of RR fluxes with pure spinors, allowing for a classification of type II supersymmetric vacua on six-manifolds. We find in particular that supersymmetric six-manifolds are always complex for IIB backgrounds while they are twisted symplectic for IIA.