BACKGROUND: Atopic dermatitis (AD) is associated with chronic itch, allergic disease and sleep disturbance, all of which might increase the risk of attention deficit (hyperactivity) disorder (ADD/ADHD). Previous analyses have found a consistent association between AD and ADD/ADHD, although the underlying factors contributing to such an association remain underexplored. Additionally, the relationship has been underexplored in adults. OBJECTIVES: To determine if childhood and adult AD and AD severity are associated with ADD/ADHD and to delineate the factors contributing to such an association. METHODS: We analysed data on 354 416 children aged 2-17 years and 34 613 adults age 18+ years from 19 U.S. population-based surveys, including the National Health Interview Survey 1997-2013 and the National Survey of Children's Health 2003/4 and 2007/8. RESULTS: In multivariate models adjusting for age, sex, sociodemographics, allergic disease and healthcare utilization, AD was associated with ADD/ADHD in both children [adjusted odds ratio (95% confidence interval), 1.14 (1.03-1.26)] and adults [1.61 (1.25-2.06)]. Children with both severe AD and only 0-3 nights of adequate sleep per week had much higher odds of ADD/ADHD [16.83 (7.02-40.33)] than those with 0-3 nights of adequate sleep per week [1.83 (1.47-2.26)] or mild-moderate AD alone [1.56 (1.22-1.99)]. AD was most strongly associated with severe ADHD. AD unaccompanied by other allergic disease was also associated with increased risk of ADD/ADHD in children. Among children with AD, history of anaemia, headaches and obesity were associated with even higher odds of ADD/ADHD. Asthma, insomnia and headaches increased the odds of ADHD in adults with AD, although underweight body mass index was protective. CONCLUSIONS: Atopic dermatitis is associated with increased odds of ADD/ADHD in adults and children. Several factors increase the risk of ADHD in adults and children with AD.