The short answer: partly. OCD runs in families, and twin studies trace about half of the risk to genes. The largest study, covering 24,768 people with OCD in Sweden, put heritability at 47%. But no single gene causes OCD. A 2025 genome study estimated that about 11,500 common variants share the effect. And most children of a parent with OCD, roughly 80% to 90%, never develop it.
NIMH lists genetics, biology, temperament, and childhood trauma as risk factors under study (NIMH). For scale, 2.3% of U.S. adults have OCD in their lifetime and 1.2% in a given year (NIMH statistics).
How much of OCD is inherited?
Twin studies answer this. Identical twins share nearly all their DNA, fraternal twins about half. If identical twins match for OCD more often, genes are at work. A 2005 review of more than 70 years of twin research found genetic influence on obsessive-compulsive symptoms of 45% to 65% in children and 27% to 47% in adults (van Grootheest et al., 2005, Twin Research and Human Genetics).
The largest study used Swedish national registers: 24,768 people diagnosed with OCD between 1969 and 2009, their relatives, and 16,383 twins. Twin modeling attributed 47% of familial risk to additive genetic factors (95% CI, 42% to 52%). Shared environment, meaning the family home, had no significant effect. The authors concluded that nonshared environmental factors are "at least as important" as genes (Mataix-Cols et al., 2013, JAMA Psychiatry).
Other reviews agree. A meta-analysis of 37 twin samples found that additive genetic effects and nonshared environment explained most of the variance, and shared environment contributed little or nothing (Taylor, 2011, Clinical Psychology Review). A 2023 systematic review of 19 family, 29 twin, and 6 population-based studies put the heritability of OCD at around 50% (Blanco-Vieira et al., 2023, Translational Psychiatry).
One caution: heritability describes how much of the variation across a population traces to genes. It does not mean half of any one person's OCD comes from DNA.
What is the risk if a parent or sibling has OCD?
Higher than average, but far from certain. In a Johns Hopkins family study, clinicians blind to group interviewed 343 relatives of 80 people with OCD and 300 relatives of 73 controls. Lifetime OCD was 11.7% in the relatives of people with OCD versus 2.7% in control relatives, about a fourfold difference (Nestadt et al., 2000, Archives of General Psychiatry).
The International OCD Foundation gives a similar figure for children: between 10% and 20% of children who have a parent with OCD will develop OCD themselves, and 80% to 90% will not (IOCDF). MedlinePlus Genetics states that the risk is greater for first-degree relatives such as siblings or children, but that the inheritance pattern of OCD is unclear (MedlinePlus Genetics).
The Swedish register study showed that risk rose in proportion to genetic relatedness: first-degree relatives highest, then second-degree, then third-degree. Relatives at the same genetic distance had similar risk even when they shared different amounts of home environment. Spouses of people with OCD also had elevated risk (odds ratio 2.61), which the authors read as possible assortative mating (Mataix-Cols et al., 2013).
The practical read: a child with one affected parent has roughly a one in eight chance of developing OCD, still a minority outcome.
Does early-onset OCD run in families more?
Probably, though less than older studies suggested. About half of OCD cases become evident in childhood or adolescence, most of the rest appear in early adulthood, and onset after age 40 is unusual (MedlinePlus Genetics).
The Johns Hopkins study found that age at symptom onset was strongly related to familiality (odds ratio 0.92 per year, 95% CI 0.85 to 0.99). No case of OCD turned up among the relatives of patients whose symptoms began at age 18 or older (Nestadt et al., 2000). That was a small sample. In the Swedish registers, 3,907 early-onset patients (mean age 13.7) had only slightly higher familial risk than the total sample, and the difference was not significant. The authors called the gap "substantially lower than previously reported" (Mataix-Cols et al., 2013). See our guide to OCD in children for how early symptoms look.
Is there a single OCD gene?
No. OCD is polygenic: many genes each add a small amount of risk. The largest genetic study to date, published in Nature Genetics in 2025, pooled 53,660 people with OCD and 2,044,417 controls. It found 30 independent genome-wide significant loci and 249 potential effector genes, with 25 flagged as most likely causal, including WDR6, DALRD3, and CTNND1. The authors estimated that about 11,500 genetic variants explained 90% of OCD's genetic heritability (Strom et al., 2025, Nature Genetics).
Genetic risk for OCD overlapped with 65 of 112 other traits, including every psychiatric disorder examined, and in particular anxiety, depression, anorexia nervosa, and Tourette syndrome. MedlinePlus Genetics also notes that variations in genes that transport or respond to serotonin have been associated with increased OCD risk (MedlinePlus Genetics).
There is no genetic test that can diagnose OCD or predict it in a child, because each variant shifts risk by a tiny amount. And the shared genetic ground with anxiety helps explain why the two so often occur together. Our explainer on OCD versus anxiety covers how to tell them apart, and anxiety.md covers the anxiety side in depth.
What environmental factors add to the risk?
Genes explain about half, so something else explains the rest. The twin data say the environment that matters is nonshared: experiences specific to one person, not the family home. The best-studied candidates are events around birth. A Swedish cohort of 2,421,284 children born from 1973 to 1996 identified 17,305 later diagnosed with OCD. Comparing siblings to control for family factors, the study found higher risk with maternal smoking of 10 or more cigarettes a day in pregnancy (hazard ratio 1.27), breech presentation (1.35), preterm birth (1.24), and a low 5-minute Apgar score (1.50). Risk rose with the number of perinatal events, from 1.11 for one to 1.51 for five or more (Brander et al., 2016, JAMA Psychiatry).
Those are small effects. A systematic review of 128 studies by the same group named perinatal complications, the reproductive cycle, and stressful life events as the main candidates, then concluded that "no environmental risk factors have convincingly been associated with OCD" (Brander et al., 2016, Neuroscience and Biobehavioral Reviews).
One exception is well defined. PANDAS is a sudden and severe onset of OCD or tics in a child after a strep infection. It typically appears between age 3 and puberty, and symptoms reach full intensity within days. NIMH recommends antibiotics for the strep infection, and children may also benefit from cognitive behavioral therapy, an SSRI, or both (NIMH, PANDAS).
What does this mean for families?
- Parenting did not cause it. Shared home environment had no significant effect in the twin studies.
- Most children of a parent with OCD will not develop it. The IOCDF estimate is 80% to 90% will not.
- Know the early signs. Symptoms usually start between late childhood and young adulthood (NIMH). A family history is a reason to act sooner on rituals, repeated questions, or avoidance.
- Genes do not set the outcome. Exposure and response prevention is the first-line therapy. Our guide to ERP therapy for OCD explains how it works.
- Skip the genetic test. No commercial test can diagnose or predict OCD.
The bottom line
OCD is about half genetic. Twin studies put heritability near 47% to 50%, and a first-degree relative raises lifetime risk from roughly 2% to roughly 10% to 12%. The rest comes from individual experience, including events around birth and, rarely, strep infection. No single gene is responsible, and no test can predict who will develop it. For families: the risk is real but modest, the cause is not parenting, and early treatment changes the course.
Last updated: August 2026. This article is for informational purposes only and does not constitute medical advice. If you or your child show signs of OCD, talk with a licensed mental health professional. If you are in crisis, call or text 988.