The MEDIA (Modelling Early DIAgenesis) software package comprises a flexible and extensible software system that provides problem-solving assistance for simulating 1D reactive transport in surface sediments. MEDIA allows multiple diagenetic models to be built by extending a model template with new model components from a toolbox of available objects (elements, species, parameters, reactions). A detailed review is given of the transport and reaction components available for model construction. Upon assemblage, the model is channelled to the numerical subunit of the MEDIA package. Via a canonical transformation, the user-defined mixed kinetic-equilibrium model is rearranged into a proper set of differential algebraic equations (DAE), for which both steady state and transient solutions can be calculated. Steady-state profiles are obtained either directly using a Newton–Raphson method, or alternatively, as the asymptotic result of a dynamic simulation. Dynamic simulations involve a global implicit procedure based on the stiff-ODE solver package VODE, employing a direct substitution approach to reduce the number of equations in the DAE system. Verification of the MEDIA code was accomplished (1) by comparison with analytic models and (2) by emulating the model formulation and output of the existing diagenetic model code STEADYSED. As an example application, a diagenetic model was constructed to analyse an extensive dataset collected from a marine sediment in the Santa Barbara Basin (California). The different pathways of organic matter mineralization were modelled, and the coupling among the biogeochemical cycles of C, O, N, S, Mn and Fe was investigated. Depth profiles of both porewater and solid-phase constituents could be reproduced with great accuracy.