The association between insomnia and metabolic syndrome remains unclear, especially among different-aged groups. A cross-sectional study with 8017 participants was performed to identify whether insomnia was associated with metabolic syndrome or not. Demographic characteristics, lifestyles and other risk factors were collected using a predesigned, semi-structured, self-administered questionnaire, and physical examinations were conducted by certificated community physicians. Insomnia was not independently associated with metabolic syndrome across all subjects; however, the association between insomnia and metabolic syndrome was statistically significant in the male group (odds ratio (OR): 1.35, 95% confidence interval (CI): 1.02–1.77) and the middle-aged group (OR: 1.40, 95% CI: 1.09–1.79) but not in the female group, the young adult group or the older group. Analyses of the individual components of metabolic syndrome revealed that insomnia was independently associated with raised blood pressure (OR: 1.24, 95% CI: 1.05–1.43) and low high-density lipoprotein cholesterol (HDL-c) (OR: 1.16, 95% CI: 1.01–1.33). Insomnia was also independently associated with the severity of metabolic abnormalities (OR: 1.17, 95% CI: 1.03–1.32). This study demonstrates an independent association between insomnia and metabolic syndrome in males and middle-aged participants, which suggests that treatment for insomnia will contribute to the prevention of metabolic syndrome in males and the middle-aged population.