Obsessive-compulsive disorder (OCD) is a prevalent mental disorder affecting ~2–3% of the population. This disorder involves genetic and, possibly, epigenetic risk factors. The dynamic nature of epigenetics also presents a promising avenue for identifying biomarkers associated with symptom severity, clinical progression, and treatment response in OCD. We, therefore, conducted a comprehensive case-control investigation using Illumina MethylationEPIC BeadChip, encompassing 185 OCD patients and 199 controls recruited from two distinct sites in Germany. Rigorous clinical assessments were performed by trained raters employing the Structured Clinical Interview for DSM-IV (SCID-I). We performed a robust two-step epigenome-wide association study that led to the identification of 305 differentially methylated CpG positions. Next, we validated these findings by pinpointing the optimal set of CpGs that could effectively classify individuals into their respective groups. This approach identified a subset comprising 12 CpGs that overlapped with the 305 CpGs identified in our EWAS. These 12 CpGs are close to or in genes associated with the sweet-compulsive brain hypothesis which proposes that aberrant dopaminergic transmission in the striatum may impair insulin signaling sensitivity among OCD patients. We replicated three of the 12 CpGs signals from a recent independent study conducted on the Han Chinese population, underscoring also the cross-cultural relevance of our findings. In conclusion, our study further supports the involvement of epigenetic mechanisms in the pathogenesis of OCD. By elucidating the underlying molecular alterations associated with OCD, our study contributes to advancing our understanding of this complex disorder and may ultimately improve clinical outcomes for affected individuals.