For a given graph G, each partition of the vertices has a modularity score, with higher values taken to indicate that the partition better captures community structure in G. The modularity q * (G) (where 0 ≤ q * (G) ≤ 1) of the graph G is defined to be the maximum over all vertex partitions of the modularity score. Modularity is at the heart of the most popular algorithms for community detection, so it is an important graph parameter to understand mathematically.In particular, we may want to understand the behaviour of modularity for the Erdős-Rényi random graph G n,p with n vertices and edge-probability p. Two key features which we find are that the modularity is 1 + o(1) with high probability (whp) for np up to 1 + o(1) (and no further); and when np ≥ 1 and p is bounded below 1, it has order (np) −1/2 whp, in accord with a conjecture by Reichardt and Bornholdt in 2006 (and disproving another conjecture from the physics literature).