BackgroundNumerous studies have verified that insomnia is associated with suicidal ideation, suicide attempts, and death by suicide. Limited population-based cohort studies have been conducted to examine the association. The present study aimed to analyze whether insomnia increases the risk of suicide attempts and verify the effects of insomnia on suicide risk.MethodsThis study is a cohort study using 2000–2013 hospitalization data from the National Health Insurance Research Database (NHIRD) to track the rate of suicide attempts among insomnia patients aged 15 years or older. In addition, a 1:2 pairing based on sex, age, and date of hospitalization was conducted to identify the reference cohort (patients without insomnia). Cox proportional hazard model was used to assess the effects of insomnia on suicide risk.ResultsThe total number of hospitalized patients aged 15 years or older was 479,967 between 2000 and 2013 (159,989 patients with insomnia and 319,978 patients without insomnia). After adjusting for confounders, suicide risk in insomnia patients was 3.533-fold that of patients without insomnia (adjusted hazard ratio [HR] = 3.533, 95% confidence interval [CI] = 3.059–4.080, P < 0.001). Suicide risk in low-income patients was 1.434-fold (adjusted HR = 1.434, 95% CI = 1.184–1.736, P < 0.001) that of non-low-income patients. Suicide risk in patients with drug dependence and with mental disorders was 1.592-fold (adjusted HR = 1.592, 95% CI = 1.220–2.077, P < 0.001) and 4.483-fold (adjusted HR = 4.483, 95% CI = 3.934–5.109, P < 0.001) that of patients without drug dependence and without mental disorders, respectively. In the female population, suicide risk in insomnia patients was 4.186-fold (adjusted HR = 4.186, 95% CI = 3.429–5.111, P < 0.001) that of patients without insomnia. Among patients aged 25–44 years, suicide risk in insomnia patients was 5.546-fold (adjusted HR = 5.546, 95% CI = 4.236–7.262, P < 0.001) that of patients without insomnia. Furthermore, the suicide risk of insomnia patients with mental disorders was 18.322-fold that of patients without insomnia and mental disorders (P < 0.001).ConclusionInsomnia, low income, drug dependence, and mental disorders are independent risk factors for suicide attempts. Female patients and those aged 25–44 years are at high risk of suicide due to insomnia. Insomnia, mental disorders, and low income exhibit a synergistic effect on suicide attempts. Clinicians should pay attention to mental status and income level of insomnia patients.Electronic supplementary materialThe online version of this article (10.1186/s12888-018-1702-2) contains supplementary material, which is available to authorized users.