We show that the stable rank, connected stable rank, general stable rank and real rank of direct products of $C^*$-algebras are equal to supremums of these ranks of their direct factors.