Superhard materials are of great interest in various practical applications, and an increasing number of research efforts are focused on their development. In this article, we demonstrate that machine learning can be successfully applied to searching for such materials. We construct a machine learning model using neural networks on graphs together with a recently developed physical model of hardness and fracture toughness. The model is trained using available elastic data from the Materials Project database and has good accuracy for predictions. We use this model to screen all crystal structures in the database and systematize all the promising hard or superhard materials, and find that diamond (and its polytypes) are the hardest materials in the database. Our results can be further used for the investigation of interesting materials using more accurate ab initio calculations and/or experiments.