For a group G and a real number x≥1 we let sG(x) denote the number of indices ≤x of subgroups of G. We call the function sG the subgroup density of G, and initiate a study of its asymptotics and its relation to the algebraic structure of G. We also count indices ≤x of maximal subgroups of G, and relate it to symmetric and alternating quotients of G.