Magnetic mineral assemblages in diagenetic environments are governed by microbial and inorganic/chemical processes. Empirical evidence and thermodynamic modelling of diagenetic environments ranging from near-surface settings to depths of about 6-7 km suggests that microbial processes are very important in surface and near-surface diagenetic settings, whereas inorganic diagenetic processes dominate in most deeper subsurface diagenetic settings. In all diagenetic environments, molecular oxygen and hydrocarbons are important because they control which types of bacteria can thrive and because they drive various redox reactions via changes in the redox potential.Iron oxides, such as hematite and goethite, are stable under relatively oxidizing/aerobic conditions. With decreasing redox potential, i.e. under relatively reducing/anaerobic conditions, magnetite and pyrrhotite are the most important stable magnetic minerals, whereas hematite is unstable. Other magnetic minerals, such as greigite, may be important in some instances. Pyrite and siderite are also important because they may form at the expense of magnetic minerals. A significant decrease in the redox potential in diagenetic settings, via the invasion of hydrocarbons during migration or seepage from traps, for example, almost invariably results in diagenetic remagnetization. As a result 'positive', 'absent' or 'negative' magnetic contrasts are generated relative to the total magnetization (or remanence, or susceptibility) before such a decrease, depending on the relative amounts of magnetic to non-magnetic minerals formed and destroyed. Thermodynamic modelling further suggests that magnetic contrasts are more probable and tend to become more 'positive' with depth and with proximity to hydrocarbon pools. Any significant change in the redox potential is likely to cause magnetic contrasts via the formation or destruction of magnetic minerals, thus generating secondary (chemical) magnetization and resetting original detrital or bacterial magnetization. The predicted magnetic contrasts are also likely to form as a result of hydrocarbon migration, and it appears possible to delineate migration timing and pathways by geomagnetic methods. Hence the predicted magnetic mineral assemblages can aid in the interpretation of palaeomagnetic studies, particularly via the recognition and proper interpretation of remagnetization. Magnetic contrasts, measured from the air, at the surface or on drill core, can be used for hydrocarbon exploration in association with other exploration methods.