Brain derived neurotrophic factor (BDNF) is associated with pain modulation and central sensitization. Recently, a role of BDNF in migraine and cluster headache pathophysiology has been suspected due to its known interaction with calcitonin gene-related peptide. Bi-center prospective study was done enrolling four diagnostic groups: episodic migraine with and without aura, episodic cluster headache, frequent episodic tension-type headache, and healthy individuals. In migraineurs, venous blood samples were collected twice: outside and during migraine attacks prior to pain medication. In cluster headache patients serum samples were collected in and outside cluster bout. Analysis of BDNF was performed using enzyme-linked immunosorbent assay technique. Migraine patients revealed significantly higher BDNF serum levels during migraine attacks (n = 25) compared with headache-free intervals (n = 53, P < 0.01), patients with tension-type headache (n = 6, P < 0.05), and healthy controls (n = 22, P < 0.001). There was no significant difference between patients with migraine with aura compared with those without aura, neither during migraine attacks nor during headache-free periods. Cluster headache patients showed significantly higher BDNF concentrations inside (n = 42) and outside cluster bouts (n = 24) compared with healthy controls (P < 0.01, P < 0.05). BDNF is increased during migraine attacks, and in cluster headache, further supporting the involvement of BDNF in the pathophysiology of these primary headaches.