Research on the effects of magnesium on sleep is limited.
However, one study found that taking a 500 mg magnesium supplement led to an improvement in insomnia.