You may already know that potassium is important for healthy bones and preventing osteoporosis, but magnesium benefits bones, too. One large study published in the American Journal of Clinical Nutrition and using subjects from the Framingham Heart Study found people who ate diets high in potassium and magnesium had higher bone density readings and stronger bones than those who didn’t.

“Magnesium is important for bone mineralization and many arthritis patients have demineralized bone, so it would benefit them to include lots of magnesium-rich foods in their diet,” says Carol Henderson, PhD, assistant professor at Georgia State University in Atlanta. This isn’t difficult since magnesium is in so many foods – and as a bonus, many of those foods are good for you in other ways, too.

One of the best sources of magnesium – and one of the easiest snacks to grab – is nuts. Magnesium also is plentiful in legumes like kidney beans and lima beans, whole grains, green vegetables, bananas, potatoes and dairy foods. These foods are also rich in potassium and calcium, two other nutrients that along with magnesium work to strengthen and protect bone.

Unsure if you’re getting enough magnesium benefits? You might consider magnesium supplements. Talk to your doctor about whether magnesium supplements are appropriate for you.