We report on the structural and magnetic properties of epitaxial thin films of the ferromagnetic shape memory material Ni–Mn–Ga prepared by DC magnetron sputter deposition. Different substrate materials, i.e., MgO(100) and Al2O3(11−20) allow for a tailored epitaxial growth. Using a sacrificial chromium buffer layer freestanding epitaxial films are obtained. In combination with photolithography partially freestanding structures such as microbridges are fabricated. The complex martensite crystal structure in substrate-constrained and freestanding films is studied by means of X-ray diffraction. The identified asymmetric twin variant configuration is associated with a macroscopic surface pattern observed by optical microscopy. The absence of magnetic-field induced strain in the (100) oriented samples is explained on basis of the detected twin variant configuration using a simplified model. Taking advantage of the thin film geometry spectroscopic methods are applied to the samples. The measurements provide the first experimental test for changes in the electronic structure of the involved 3d metals during a martensitic transition. Exploiting the X-ray magnetic circular dichroism quantitative information on the element-specific spin and orbital magnetic moments are accessed. In addition, angular-dependent experiments allow us to trace the microscopic origin of the magnetic anisotropy in Ni2MnGa improving the fundamental understanding of this material.