Abstract Oil shales and coal have considerable amount of pyrite which undergoes various thermal transformations during their processing or combustion. Reactions and changes in pyrite chemistry vary considerably under different environmental conditions. In this paper, we report an in situ high-temperature X-ray diffraction study of phase transformations in pyrite under variable environmental conditions (atmospheric pressure (1 atm.), low air pressure (<0.001 atm.), inert and carbon dioxide atmosphere). We observe that while heating of pyrite in air promotes the formation of hematite (α-Fe 2O 3), magnetite (Fe 3O 4) is a major product in low pressure environment. On the other hand, in the inert environments (nitrogen and argon) pyrrhotite, a non-stoichiometric iron sulphide, is the most dominant product. However, in carbon dioxide (CO 2) environment, pyrrhotite is an intermediate low temperature product which further transforms into magnetite and hematite, attributed to the dissociation of the CO 2 into O 2 and CO providing conducive conditions for the oxidation. We also propose the possible reaction pathways including self-dissociation of CO 2.