The first principles calculations were performed to investigate site preferences of the alloying elements M (Ti, Nb) doping in Ni3Al, elastic properties and the electronic structure of Ni3Al and Ni3Al-M with the Cambridge sequential total energy package (CASTEP). It was found that M were preferred to replace the Al sites. As the M doping. The bulk, shear and Young's modulus increased and the bulk/shear modulus ratios (B/G) decreased in Ni3Al polycrystalline alloy. While B/G of all alloys were larger than 1.75, signifying that Ni3Al, Ni24Al7Nb and Ni24Al7Ti polycrystalline alloys possessed ductility. Analyzing the electronic structure of Ni3Al and Ni3Al-M, the results showed that the main interaction between the Ni atoms and the Al atoms was covalence in the Ni3Al, after doping elements M (Ti, Nb) in Ni3Al, there was strong orbital hybridization between the Al-3p orbital, Ni-3d orbital and M-d (Ti-3d, Nb-4d) orbital, the covalent bonds between alloying atoms M (Ti, Nb) and their neighbor atoms Ni were stronger than that between Al atom and Ni atom.