Electrochemical conversion of ammonia to nitrogen has important energy and environmental applications but is hindered by lack of efficient electrocatalysts. Here the authors use quantum chemistry and machine learning to gain insights into the reaction mechanism and accelerate the design of highly active Ir-free trimetallic catalysts.