Cereals, legumes, green vegetables (like spinach), fruits (bananas, raspberries, avocado), nuts, seeds, seafood, and tofu are some food sources rich in magnesium.