This is why we get cramps at night

prove deficiency.

People with kidney disease should be especially careful with magnesium supplements.

If cramps are frequent, ask a healthcare professional whether testing makes sense.

What About Potassium?
Low potassium can also affect muscles, but too much potassium can be dangerous.

It is usually safer to get potassium from food unless a clinician recommends supplements.

Good sources include:

Potatoes
Beans
Lentils
Bananas
Avocados
Yogurt
Leafy greens
Simple Ways to Reduce Night Cramps
Helpful habits may include:

Staying appropriately hydrated
Stretching regularly
Increasing exercise gradually
Moving more during the day
Wearing