In a previous work, exact formulae and differential equations were found for traces of powers of the zero mode in the W 3 algebra. In this paper we investigate their modular properties, in particular we find the exact result for the modular transformations of traces of W n 0 for n = 1, 2, 3, solving exactly the problem studied approximately by Gaberdiel, Hartman and Jin. We also find modular differential equations satisfied by traces with a single W 0 inserted, and relate them to differential equations studied by Mathur et al. We find that, remarkably, these all seem to be related to weight 0 modular forms with expansions with non-negative integer coefficients.