Let Mg,l be the moduli space of stable algebraic curves of genus g with l marked points.
With the operations which relate the different moduli spaces identifying marked points, the family
(Mg,l)g,l is a modular operad of projective smooth Deligne-Mumford stacks, M. In this paper we
prove that the modular operad of singular chains C?(M;Q) is formal; so it is weakly equivalent to the
modular operad of its homology H?(M;Q). As a consequence, the “up to homotopy” algebras of these
two operads are the same. To obtain this result we prove a formality theorem for operads analogous
to Deligne-Grifiths-Morgan-Sullivan formality theorem, the existence of minimal models of modular
operads, and a characterization of formality for operads which shows that formality is independent of
the ground field