||Magnetic shape memory nanostructures have a great potential in the field of the nanoactuators. The relationship between dimensionality, microstructure and magnetism characterizes the materials performance. Here, we study the martensitic transformation in supported and free-standing epitaxial Ni47Mn24Ga29 films grown by sputtering on (0â€‰0â€‰1) MgO using a stoichiometric Ni2MnGa target. The films have a Curie temperature of ~390 K and a martensitic transition temperature of ~120 K. Similar transition temperatures have been observed in films with thicknesses of 1, 3 and 4 Î¼m. Thicker films (with longer deposition time) present a wider martensitic transformation range that can be associated with small gradients in their chemical concentration due to the high vapour pressure of Mn and Ga. The magnetic anisotropy of the films shows a strong change below the martensitic transformation temperature. No features associated with variant reorientation induced by magnetic field have been observed. Annealed films in the presence of a Ni2MnGa bulk reference change their chemical composition to Ni49Mn26Ga25. The change in the chemical composition increases the martensitic transformation temperature, being closer to the stoichiometric compound, and reduces the transformation hysteresis. In addition, sharper transformations are obtained, which indicate that chemical inhomogeneities and defects are removed. Our results indicate that the properties of Niâ€“Mnâ€“Ga thin films grown by sputtering can be optimized (fixing the chemical concentration and removing crystalline defects) by the annealing process, which is promising for the development of micromagnetic shape memory devices.