The article describes the physiological role of magnesium in the human body and its importance for metabolic processes. The reasons for the development of magnesium deficiency and hypermagnesaemia and its clinical symptoms are shown. The specialties of magnesium metabolism disturbances in gastroenterological pathology are described. Particular attention paid to the correction of magnesium levels with deviations of its content in the organism.