Abstract In this paper, the effect of high temperature on the mechanical properties of quartz-rich sandstone was studied by true triaxial pressure experiment. The density, P-wave velocity, elastic modulus, peak stress, peak strain, and failure mode of quartz-rich sandstone before and after heat treatment were analyzed and compared. It was found that the color of quartz-rich sandstone changes greatly when heated to 500°C. In detail, the brittleness of quartz-rich sandstone gradually decreased and the ductility increased at high temperature. Although the density, P-wave velocity, and elastic modulus fluctuate, they showed a decreasing trend as a whole. In addition, the peak stress and peak strain showed an overall upward trend with the increase of temperature, and 500°C was the high-temperature failure threshold of quartz-rich sandstone. The failure mode of quartz-rich sandstone at high temperature changes from shear failure to shear-tension combined failure, and the number of cracks increases. Therefore, these research results can provide a certain reference for high-temperature underground operation.