We show that every AF-algebra is generated by a single operator. This was previously unclear, since the invariant that assigns to a C*-algebra its minimal number of generators lacks natural permanence properties. In particular, it may increase when passing to ideals or inductive limits. To obtain a better behaved theory, we not only ask if a C*-algebra is generated by $n$ elements, but also if generating $n$-tuples are dense. This defines the generator rank, which we show has many natural permanence properties: it does not increase when passing to ideals, quotients or inductive limits.