Magnesium is a vital mineral that takes part in hundreds of enzymatic reactions in the human body. In the past several years, new information emerged in regard to the antibacterial effect of magnesium. Here we elaborate on the recent knowledge of its antibacterial effect with emphasis on its ability to impair bacterial adherence and formation complex community of bacterial cells called biofilm. We further talk about its ability to impair biofilm formation in milk that provides opportunity for developing safer and qualitative dairy products. Finally, we describe the pronounced advantages of enrichment of food with magnesium ions, which result in healthier and more effcient food products. © 2019 by the authors.