A high-throughput and data-mining search for rare-earth-free permanent magnets is reported for materials containing a 3d and p-element of the Periodic Table. Three of the most promising compounds, Fe 2 C, Mn2MoB4 , and Mn2WB4, were investigated in detail by ab initio electronic structure theory coupled to atomistic spin-dynamics. For these systems doping protocols were also investigated and, in particular, (Fe0.75X0.25)(2) C (X = Mn, Cr, V, and Ti), Mn2XB4 (X = Mo and W) along with Mn 2 (X0.5Y0.5)B-4 (X,Y = Mo, W, Ta, Cr) are suggested here as promising candidates for applications as permanent magnets. [GRAPHICS] IMPACT STATEMENT Several promising high-performance rare-earth-free permanent magnets have been found as a result of an ab initio high-throughput search. Alteration proposed to improve their stability and magnetic properties.