A rack on $[n]$ can be thought of as a set of maps $(f_x)_{x in [n]}$, where each $f_x$ is a permutation of $[n]$ such that $f_{(x)f_y} = f_y^{-1}f_xf_y$ for all $x$ and $y$. In 2013, Blackburn showed that the number of isomorphism classes of racks on $[n]$ is at least $2^{(1/4 - o(1))n^2}$ and at most $2^{(c + o(1))n^2}$, where $c approx 1.557$; in this paper we improve the upper bound to $2^{(1/4 + o(1))n^2}$, matching the lower bound. The proof involves considering racks as loopless, edge-coloured directed multigraphs on $[n]$, where we have an edge of colour $y$ between $x$ and $z$ if and only if $(x)f_y = z$, and applying various combinatorial tools.