  We use mixed Hodge theory to show that the functor of singular chains with
rational coefficients is formal as a lax symmetric monoidal functor, when
restricted to complex schemes whose weight filtration in cohomology satisfies a
certain purity property. This has direct applications to the formality of
operads or, more generally, of algebraic structures encoded by a colored
operad. We also prove a dual statement, with applications to formality in the
context of rational homotopy theory. In the general case of complex schemes
with non-pure weight filtration, we relate the singular chains functor to a
functor defined via the first term of the weight spectral sequence.
