The effect of temperature levels and hole diameter on the mechanical behaviour of intact and flawed sandstone specimens containing a single hole was analysed based on uniaxial compression test results. It was found that, with increasing temperature, both the peak strength and elastic modulus first increase gradually and then decrease sharply, reaching maximum values at 400uC. These two mechanical parameters of the flawed specimens were significantly lower than those of the corresponding intact specimens, with the extent of reduction being distinctly related to the hole diameter. Thermal damage of sandstone specimens changed gradually from ‘negative thermal damage’ to positive values with increasing temperature, while the variation of the thermal damage increased gradually with the diameter. The ultimate failure modes and crack coalescence behaviour were also evaluated for the flawed specimens after high temperature, and crack types (tensile crack, hole collapse, far-field crack and surface spalling) based on the crack coalescence mechanism are discussed. The sequence of crack coalescence in a flawed sandstone specimen after high temperature was captured, and its effect on the macroscopic axial stress–strain curve was also investigated.