The Phase stability, electronic structure, elastic properties and hardness of Ru–Ir alloys (Ru5Ir15, Ru6Ir14, Ru8Ir12) were investigated by first principles calculations. The negative values of cohesive energy and formation enthalpy show that these compounds are thermodynamically stable, and Ru–Ir alloys tend to exist in the form of Ru5Ir15, Ru6Ir14 and Ru8Ir12. The calculated results of electronic structure reveal that strong hybridizations exist near the Fermi level, being characteristic of Ru-d and Ir-d states, as a result, it is mainly composed of Ru–Ir bond in Ru–Ir alloy. The elastic properties were calculated, which included bulk modulus, shear modulus, Young's modulus, Poisson's ratio and hardness. The calculated results reveal that Ru6Ir14 compound has the highest hardness, and Ru8Ir12 compound has the maximal elastic anisotropy ratio. Meanwhile, Ru5Ir15, Ru6Ir14, Ru8Ir12 are brittle, and the vickers hardness values of these alloys are 25.29 GPa, 27.96 GPa, 27.39 GPa, respectively.