The development of intrinsic and extrinsic stresses in TiNi and TiNiHf thin films, and their relaxation during isochronal and isothermal annealing, has been studied in both crystalline and amorphous materials sputtered onto (100) silicon. The development of intrinsic compressive stress was sensitive to both deposition pressure and temperature, and to film thickness, and was thermally stable below the deposition temperature. Kinetic parameters for isothermal stress relaxation and isothermal crystallization were determined. A two-stage process for both isochronal and isothermal stress relaxation was identified, with an initial stress change governed by a structural modification mechanism characterized by large activation volume and energy, giving way to a slower, diffusioncontrolled relaxation mechanism. Tensile stresses developed during isothermal crystallization were found to relax at rates that depended on deviation of the film composition from stoichiometry. The results are important with respect to the deployment of shape-memory thin films in microelectromechanical systems (MEMS), in which large extrinsic tensile stresses can be exploited to enable reversible high-energy mechanical actuation.