We study the modular class of Q-manifolds, and in particular of negatively graded Lie ∞-algebroid. We show the equivalence of several descriptions of those classes, that it matches the classes introduced by various authors and that the notion is homotopy invariant. In the process, the adjoint and coadjoint actions up to homotopy of a Lie ∞-algebroid are spelled out. We also wrote down explicitly some dualities, e.g. between representations up to homotopies of Lie ∞-algebroids and their Q-manifold equivalent, which we hope to be of use for future reference. action, or as the divergence of the vector field that dualizes the Lie ∞-brackets. We also show that it is well-behaved under Lie ∞-morphisms, and their homotopies.In Sections 3 and 4, we enlarge this construction to negatively graded Q-manifolds. Again, we show that it can be defined either as the divergence of the Q-vector field, but also as the super-trace of the adjoint action. This requires a precise description of adjoint and coadjoint actions for Q-manifolds that extend the Abad-Crainic adjoint representations of to homotopy [16,1,43] for Lie algebroids. We then show invariance under homotopy equivalence. Various examples are then given, and the geometric meaning is detailed.