Iron status is the most treatable cause and the most commonly missed. This is one of the few places a ferritin really matters.
Restless legs syndrome is an urge to move the legs, worse at rest and in the evening, relieved by movement. It is common, it disrupts sleep badly, and it has a treatable cause that is routinely missed.
Iron status is the key. Brain iron insufficiency is central to restless legs syndrome, and a ferritin below about 75 mcg/L is generally treated even if the haemoglobin is normal — the threshold is higher than the usual definition of iron deficiency. Iron supplementation in that setting improves symptoms substantially in many people. This is a blood test and it is the highest-value action on the page, and it is commonly not done because the haemoglobin is normal.
Medication review. Several common drugs worsen restless legs: sedating antihistamines (diphenhydramine, and many over-the-counter sleep aids), most antidepressants, dopamine antagonist antiemetics (metoclopramide, prochlorperazine), and some antihypertensives. A person with restless legs taking an antihistamine at night for sleep is making it worse — this is one of the most useful things to know on this page and it is very commonly missed.
Other causes to exclude. Iron deficiency, kidney disease, diabetes and peripheral neuropathy, pregnancy (restless legs is common and usually resolves), and low ferritin generally.
What helps. Iron supplementation if the ferritin is low; correcting the cause; gentle exercise and stretching in the evening; reducing caffeine and alcohol in the evening; a warm bath before bed; and, if symptoms are still troublesome, prescription treatment — dopamine agonists (which carry an augmentation risk with long-term use), alpha-2-delta ligands (gabapentin, pregabalin), or others, decided by a clinician.
Magnesium is commonly recommended, and the trials are weak. Given that magnesium supplementation is genuinely dangerous in kidney impairment, and that kidney disease is a cause of restless legs, check kidney function first.
Cramp and restless legs are different. Cramp is a painful muscle contraction; restless legs is an urge to move. For cramp, see the cramps page — and the same lesson applies: magnesium is the folk answer and the trials did not support it.