Overview.
Chronic insomnia affects 10-15% of adults and has profound health consequences — increasing risk of cardiovascular disease, diabetes, depression, and all-cause mortality. While most insomnia is behavioural (poor sleep hygiene, stress, anxiety), several medical conditions cause or worsen insomnia through distinct mechanisms: thyroid dysfunction, iron deficiency (restless legs), cortisol dysregulation, magnesium depletion, and blood sugar instability. A targeted lab workup identifies these treatable causes.
Insomnia is difficulty initiating sleep, maintaining sleep, or early morning awakening, occurring at least 3 nights per week for at least 3 months, despite adequate sleep opportunity. Sleep-onset insomnia (can't fall asleep) and sleep-maintenance insomnia (waking at 2-4 AM) have different differential diagnoses and may point to different medical causes.
Prevalence: 10-15% of adults meet criteria for chronic insomnia disorder. Up to 30-40% report insomnia symptoms at any given time. Women are 1.5x more likely to have insomnia than men. Prevalence increases with age.
What to test.
First-line tests
- TSH — Both hyperthyroidism (causes insomnia through hyperarousal, tachycardia, anxiety) and hypothyroidism (causes daytime fatigue but paradoxically disrupts sleep architecture) affect sleep quality.
- Ferritin — Iron deficiency is the most common modifiable cause of restless legs syndrome (RLS) — an urge to move the legs that worsens at rest and at night, preventing sleep. Ferritin <75 ng/mL is the treatment threshold for RLS (lower than the general deficiency threshold).
- CMP (Metabolic Panel) — Screens for calcium abnormalities (hypercalcaemia causes insomnia), liver dysfunction (hepatic encephalopathy disrupts sleep-wake), kidney dysfunction (uraemia causes restless legs), and glucose abnormalities.
- CBC — Anaemia causes tachycardia and restlessness. Polycythaemia (high red cells) may suggest sleep apnoea (chronic hypoxia).
Second-line tests
- Magnesium (RBC Magnesium preferred) — Magnesium is a natural GABA receptor agonist and nervous system relaxant. Deficiency is associated with insomnia, anxiety, and muscle cramps that disturb sleep. RBC magnesium is more accurate than serum.
- Cortisol (AM and/or salivary cortisol rhythm) — Cortisol should be lowest at bedtime and peak at waking. Disrupted cortisol rhythm (high evening cortisol) prevents sleep onset. Cushing's syndrome causes severe insomnia.
- Fasting Glucose + HbA1c — Nocturnal hypoglycaemia causes 2-4 AM awakenings with anxiety, sweating, and hunger. Blood sugar instability disrupts sleep architecture.
- Vitamin D — Vitamin D receptors are present in sleep-regulating brain regions. Deficiency is associated with shorter sleep duration and poorer sleep quality in observational studies.
Specialized tests
- Testosterone (Men) — Low testosterone in men is associated with sleep fragmentation and sleep apnoea. Conversely, sleep apnoea suppresses testosterone. The relationship is bidirectional.
- FSH / Estradiol (Perimenopause) — Perimenopausal hormone fluctuations cause vasomotor symptoms (night sweats, hot flashes) that severely disrupt sleep. Consider in women 40-55 with new-onset insomnia.
Common causes.
- Hyperthyroidism — Insomnia with racing mind, palpitations, anxiety, weight loss, heat intolerance
- Iron Deficiency / Restless Legs — Irresistible urge to move legs at rest, especially at bedtime. Temporarily relieved by movement.
- Perimenopause — Night sweats and hot flashes causing multiple awakenings. New-onset in women 40-55.
Diagnostic patterns.
- Low ferritin (<75 ng/mL) + restless legs at bedtime + sleep-onset insomnia — likely Iron deficiency-driven restless legs syndrome. Next step: Iron supplementation (ferrous bisglycinate or IV iron); target ferritin >75 ng/mL
- Low TSH + elevated FT4 + insomnia + palpitations + weight loss — likely Hyperthyroidism. Next step: Endocrinology referral for thyroid workup and treatment
- Normal labs + poor sleep hygiene + response to CBT-I — likely Primary insomnia (behavioural). Next step: CBT-I (cognitive behavioural therapy for insomnia) is first-line treatment
- 2-4 AM awakenings + anxiety/hunger on waking + elevated fasting insulin — likely Nocturnal hypoglycaemia / reactive blood sugar instability. Next step: Protein-rich snack before bed; reduce refined carbohydrates at dinner; assess HOMA-IR
Lifestyle.
Non-medical causes
- Poor sleep hygiene (irregular schedule, screen time, bedroom environment)
- Caffeine after 12 PM (caffeine half-life is 5-6 hours)
- Alcohol (sedates initially but fragments sleep in second half of night)
- Stress, anxiety, depression (bidirectional with insomnia)
- Shift work and jet lag
- Medications: corticosteroids, beta-agonists, SSRIs, stimulants, diuretics
- Chronic pain
- Environmental factors (noise, light, temperature, partner disturbance)
Considerations
- Consistent wake time 7 days/week (the single most important sleep hygiene intervention)
- No caffeine after 12 PM (or eliminate entirely as a 2-week trial)
- Blue light reduction 1-2 hours before bed
- Cool bedroom temperature (18-20°C / 64-68°F)
- CBT-I (cognitive behavioural therapy for insomnia) is more effective than medication long-term
- Regular exercise (but not within 2-3 hours of bedtime)
- Alcohol-free trial for 2 weeks to assess sleep quality impact
FAQs.
What blood tests should I ask for if I can't sleep?
Start with: TSH (thyroid), ferritin (iron/restless legs), CMP (metabolic), and CBC. If these are normal, consider: magnesium (RBC), cortisol, fasting glucose/HbA1c, and vitamin D. For women 40-55: consider FSH/estradiol for perimenopause.
Can low iron really cause insomnia?
Yes — through restless legs syndrome (RLS). Iron is a cofactor for dopamine synthesis, and low iron in the brain disrupts the dopaminergic pathways that control leg movement. The RLS treatment threshold for ferritin is <75 ng/mL — higher than the general iron deficiency cutoff. Many people with RLS have 'normal' ferritin that is actually too low for their brain.
I wake up at 2-4 AM every night — is that medical?
2-4 AM awakenings can have specific medical causes: nocturnal hypoglycaemia (blood sugar crash — often with anxiety and hunger), cortisol rhythm disruption (early cortisol surge), or sleep apnoea (arousal from obstruction). If you wake with anxiety, sweating, or hunger, check fasting insulin and glucose. If you snore or have witnessed apnoeas, pursue sleep apnoea assessment.