For pure metals aluminum and magnesium for chemical compounds Al3Mg, Al2Mg, AlMg AlMg3 with crystallographic orientations (100), (110) (111) the work function is calculated from first principles in framework of density functional theory. It shown that dependence on concentration aluminium nonlinear. The reasons differences depending orientation are analysed.