Background and purpose Migraine is a common and costly neurological disorder. The aims of this study were to quantify the costs of chronic (CM) and episodic migraine (EM) in Spain, evaluating the impact of psychiatric comorbidities and disability, and to estimate the economic savings associated with reducing the number of migraine-days by 50%. Methods This was an observational, cross-sectional analysis of data from migraine patients who participated in the Spanish Migraine Atlas. The participants were invited to complete a structured questionnaire including the following scales: the Headache Needs Assessment, the Hospital Anxiety and Depression Scale, and the Migraine Disability Assessment Scale (MIDAS). Results A total of 475 patients were included, of whom 187 had CM (39.4%). Total costs per patient/year were: euro16 578.2 +/- euro34 568.1 for CM and euro6227.8 +/- euro6515.7 for EM. A higher degree of disability, according to MIDAS, significantly increased the total cost of migraine, while the presence of psychiatric comorbidity increased costs for EM patients only. A reduction of 1 migraine-day per month decreased average total costs by euro744.14 per patient/year for EM and euro663.20 per patient/year for CM, while a reduction in the number of migraine-days by 50% would result in economic savings of euro2232.44 per patient/year (R-2 = 0.927) for EM and euro6631.99 per patient/year (R-2 = 0.886) for CM. Conclusions The costs associated with migraine were driven by migraine frequency and the degree of disability, whereas psychiatric comorbidity only influenced the cost of EM. These results highlight the need to optimize migraine management to reduce the economic migraine burden. Future studies are needed to confirm our results.