The modular class is a generalization of the divergence of vector fields to other geometric structures such as Poisson manifolds and Lie algebroids. The modular class of a regular foliation involves a volume form on the conormal bundle and the associated Bott connection. It is a closed one form along the leaves. The vanishing of this modular class implies that there exists a volume form which is invariant along the leaves. In the singular case, the above definition can not be summoned since the conormal bundle may not be even well defined. We will show that a convenient way of defining the modular class of a singular foliation is to define it from the universal Lie infinity-algebroid of the singular foliation.