BACKGROUND: Nutrients consumed with food undergo the digestion process, and only some of them are absorbed from the gastrointestinal tract (GI) and enter the bloodstream. Minerals, including Mg, are crucial for maintaining the body's homeostasis, but their beneficial effect depends on their bioavailability, i.e., the part that can be absorbed and used by the body. The bioavailability of nutrients taken in pharmaceutical form is usually higher than the same nutrients contained in food, because their absorption requires prior release from the food matrix. OBJECTIVES: The main objective of the conducted research was to assess the bioavailability of Mg from dietary supplements and medicinal products, considering the influence of the type of diet and pharmaceutical form on bioavailability. METHODS: The experiments were conducted using a previously developed and optimized two-stage in vitro digestion model using cellulose dialysis tubes and ICP-OES method. The influence of three types of diets-standard, basic and high-residue-on the bioavailability of Mg was evaluated. RESULTS: The bioavailability of Mg from the studied diets was within the range of 48.74-52.51%. CONCLUSIONS: In the models studied, it was observed that the factors influencing bioavailability were the nutritional composition of the diets and the chemical form of Mg.