To clarify the different effects of alloying elements on the strength of Ni and Ni3Al, this study employs Firstprinciples methods to investigate the effects of refractory elements Re, Ru, Ta, Mo and W on the generalized stacking fault energy and ideal strength of Ni and Ni3Al, respectively. The results reveal that the alloying elements Re, Ru, Ta, Mo, and W can help to improve the creep strength of Ni but reduce that of Ni3Al. Among these alloying elements, Re and Ru are more helpful for improving the strength of Ni, and for Ni3Al, Ru has the weakest enhancing effect on the strength of Ni3Al. Moreover, except for Ru, other alloying elements have more significant enhancing effects on the strength of Ni3Al. The electronic structure analysis shows that the d orbitals of alloying elements except Ru can form deep and wide pseudogap near the Fermi energy level, which causes the obvious enhancement of the strength of Ni3Al. Furthermore, the regular areas of charge distribution between atom Ru and its nearest neighbor atoms Ni are more vulnerable to be destroyed, resulting in Ni3Al-Ru owning a relatively lower ideal tensile strength and reaches its ideal tensile strength under a smaller strain.