© 2015 Elsevier Inc. All rights reserved. Control of stress in porous silicon (PS) through porosity changes was studied using X-ray diffraction rocking curve measurements. The effect of thermal annealing on the stress was also investigated with both X-ray diffraction and radius of curvature measurements. Annealed films could achieve compressive or tensile stress. The effect of annealing was reversed by a short HF dip, except in the case of nitridised samples (annealed in N2 at temperatures above 500 °C). The effect of hydrogen desorption, oxidation and nitridation, modified via annealing temperature and ambient, was studied to understand the evolution of physical properties and the mechanism of the stress modification. The effect of stress on PS microbeams was studied to determine the influence when PS films are used as the structural layer in a micromachined device. When modelling the effect of stress changes on the order of those observed during thermal annealing, the results indicated that for PS-based microbeams, stress is a significant factor in determining resonant frequency, far more than found in nonporous materials, illustrating the need for accurate control of stress.