Mineral imbalances may also play a role. Low levels of magnesium, potassium, or calcium can affect normal muscle function and trigger painful contractions. Poor diet, excessive sweating, or certain medications may contribute to these deficiencies.
Poor blood circulation is another potential reason. If blood flow to the legs is reduced, muscles may not receive enough oxygen, leading to cramping — particularly during periods of rest at night. In some cases, underlying conditions such as diabetes or nerve disorders may also contribute to frequent leg cramps.
People who spend long hours standing, sitting, or exercising intensely may experience muscle fatigue that increases the likelihood of cramps. Pregnancy can also make nighttime cramps more common due to changes in circulation and mineral needs.
Certain medications, including diuretics and cholesterol-lowering drugs, have been associated with muscle cramps as well. If the symptoms started after beginning a new medication, it may be worth discussing with a healthcare professional.