Studies have shown that people with obsessive–compulsive disorder (OCD) have impairments in spatial working memory (SWM) performance. However, it remains unclear whether this deficit represents a cognitive endophenotype preceding symptoms or a correlate of OCD. We investigated SWM in 69 people with OCD, 77 unaffected first-degree relatives of people with OCD and 106 healthy control participants. Taking age effects into account, SWM performance was best in healthy controls, intermediate in relatives and worst in OCD participants. However, since performance did not differ significantly between healthy controls and relatives, our study does not fully support SWM performance as a core cognitive endophenotype of OCD.