Cognitive impairment is common among individuals diagnosed with autism spectrum disorder (ASD) and attention-deficit hyperactivity disorder (ADHD). It has been suggested that some aspects of intelligence are preserved or even superior in people with ASD compared with controls, but consistent evidence is lacking. Few studies have examined the genetic overlap between cognitive ability and ASD/ADHD. The aim of this study was to examine the polygenic overlap between ASD/ADHD and cognitive ability in individuals from the general population. Polygenic risk for ADHD and ASD was calculated from genome-wide association studies of ASD and ADHD conducted by the Psychiatric Genetics Consortium. Risk scores were created in three independent cohorts: Generation Scotland Scottish Family Health Study (GS:SFHS) (n=9863), the Lothian Birth Cohorts 1936 and 1921 (n=1522), and the Brisbane Adolescent Twin Sample (BATS) (n=921). We report that polygenic risk for ASD is positively correlated with general cognitive ability (beta=0.07, P=6 × 10-7, r2=0.003), logical memory and verbal intelligence in GS:SFHS. This was replicated in BATS as a positive association with full-scale intelligent quotient (IQ) (beta=0.07, P=0.03, r2=0.005). We did not find consistent evidence that polygenic risk for ADHD was associated with cognitive function; however, a negative correlation with IQ at age 11 years (beta=−0.08, Z=−3.3, P=0.001) was observed in the Lothian Birth Cohorts. These findings are in individuals from the general population, suggesting that the relationship between genetic risk for ASD and intelligence is partly independent of clinical state. These data suggest that common genetic variation relevant for ASD influences general cognitive ability.