The Trail Making Test is a widely used test of executive function and has been thought to be strongly associated with general cognitive function. We examined the genetic architecture of the trail making test and its shared genetic aetiology with other tests of cognitive function in 23 821 participants from UK Biobank. The SNP-based heritability estimates for trail-making measures were 7.9 % (part A), 22.4 % (part B), and 17.6 % (part B - part A). Significant genetic correlations were identified between trail-making measures and verbal-numerical reasoning (rg > 0.6), general cognitive function (rg > 0.6), processing speed (rg > 0.7), and memory (rg > 0.3). Polygenic profile analysis indicated considerable shared genetic aetiology between trail making, general cognitive function, processing speed, and memory (standardized β; between 0.03 and 0.08). These results suggest that trail making is both phenotypically and genetically strongly associated with general cognitive function and processing speed.