Obsessive-compulsive disorder (OCD) is a common psychiatric disorder with a lifetime prevalence of 2-3 percent. Recently, brain activity in the resting state is gathering attention as a new means of exploring altered functional connectivity in psychiatric disorders. Although previous resting-state functional magnetic resonance imaging studies investigated neurobiological abnormalities of patients with OCD, there are concerns that should be addressed. One concern is the validity of the hypothesis employed. Most studies used seed-based analysis of the fronto-striatal circuit, despite the potential for abnormalities in other regions. A hypothesis-free study is a promising approach in such a case, while it requires researchers to handle a dataset with large dimensions. Another concern is the reliability of biomarkers derived from a single dataset, which may be influenced by cohort-specific features. Here, by employing a recently developed machine-learning algorithm to avoid these concerns, we identified the first OCD biomarker that is generalized to an external dataset. We also demonstrated that the functional connectivities that contributed to the classification were widely distributed rather than locally constrained. Our generalizable classifier has the potential not only to deepen our understanding of the abnormal neural substrates of OCD but also to find use in clinical applications.