Insomnia is a major public health problem considering its high prevalence, impact on daily life, co-morbidity with other disorders and societal costs. Cognitive behavioral treatment for insomnia (CBTI) is currently considered to be the preferred treatment. However, no meta-analysis exists of all studies using at least one component of CBTI for insomnia, which also uses modern techniques to pool data and to analyze subgroups of patients. We included 87 randomized controlled trials, comparing 118 treatments (3724 patients) to non-treated controls (2579 patients). Overall, the interventions had significant effects on: insomnia severity index (g = 0.98), sleep efficiency (g = 0.71), Pittsburgh sleep quality index (g = 0.65), wake after sleep onset (g = 0.63) and sleep onset latency (SOL; g = 0.57), number of awakenings (g = 0.29) and sleep quality (g = 0.40). The smallest effect was on total sleep time (g = 0.16). Face-to-face treatments of at least four sessions seem to be more effective than self-help interventions or face-to-face interventions with fewer sessions. Otherwise the results seem to be quite robust (similar for patients with or without comorbid disease, younger or older patients, using or not using sleep medication). We conclude that CBTI, either its components or the full package, is effective in the treatment of insomnia.