We have explored, computationally and experimentally, the magnetic properties of (Fe 1−x Co x ) 2 B alloys. Calculations provide a good agreement with experiment in terms of the saturation magnetization and the magnetocrystalline anisotropy energy with some difficulty in describing Co 2 B, for which it is found that both full potential effects and electron correlations treated within dynamical mean field theory are of importance for a correct description. The material exhibits a uniaxial magnetic anisotropy for a range of cobalt concentrations between x = 0.1 and x = 0.5. A simple model for the temperature dependence of magnetic anisotropy suggests that the complicated nonmonotonic behavior is mainly due to variations in the band structure as the exchange splitting is reduced by temperature. Using density functional theory based calculations we have explored the effect of substitutionally doping the transition metal sublattice by the whole range of 5d transition metals and found that doping by Re or W elements should significantly enhance the magnetocrystalline anisotropy energy. Experimentally, W doping did not succeed in enhancing the magnetic anisotropy due to formation of other phases. On the other hand, doping by Ir and Re was successful and resulted in magnetic anisotropies that are in agreement with theoretical predictions. In particular, doping by 2.5 at. % of Re on the Fe/Co site shows a magnetocrystalline anisotropy energy which is increased by 50% compared to its parent (Fe 0.7 Co 0.3 ) 2 B compound, making this system interesting, for example, in the context of permanent magnet replacement materials or in other areas where a large magnetic anisotropy is of importance.