We consider the problem of determining mn, the number of matroids on n elements. The best known lower bound on mn is due to Knuth (1974) who showed that log log mn is at least n− 3 2 log n−O(1). On the other hand, Piff (1973) showed that log log mn ≤ n − log n + log log n + O(1), and it has been conjectured since that the right answer is perhaps closer to Knuth’s bound. We show that this is indeed the case, and prove an upper bound on log log mn that is within an additive 1 + o(1) term of Knuth’s lower bound. Our proof is based on using some structural properties of non-bases in a matroid together with some properties of independent sets in the Johnson graph to give a compressed representation of matroids