The compressibility of solid helium ( 3 He and 4 He) in the hcp and fcc phases has been studied by path-integral Monte Carlo. Simulations were carried out in both canonical (N V T ) and isothermalisobaric (N P T ) ensembles at temperatures between 10 and 300 K, showing consistent results in both ensembles. For pressures between 4 and 10 GPa, the bulk modulus B is found to decrease by about 10%, when temperature increases from the low-temperature limit to the melting temperature. The isotopic effect on the bulk modulus of helium crystals has been quantified in a wide range of parameters. At 25 K and pressures on the order of 1 GPa, the relative difference between 3 He and 4 He amounts to about 2%. The thermal expansion has been also quantified from results obtained in both N P T and N V T simulations.