The magnetic properties of the different phases of Ni2MnGa and the defect formation energies in off-stoichiometric Ni2MnGa are systematically investigated by means of the first-principles calculations within the framework of density functional theory using the Vienna Ab Initio Software Package. The individual magnetic moment of each constituent atom keeps constant in austenite and NM martensite, whereas those of Ni and Mn in the 5M and 7M martensites oscillate according to the atomic position. The formation energies of the various point defects (antisite and vacancy) have been systematically calculated. Furthermore, the magnetic structures of the defective structures have been shown in detail. © 2012 Wiley Periodicals, Inc.