The objective of this study was to assess serum, hair, and urinary magnesium (Mg) levels in children with attention-deficit/ hyperactivity disorder (ADHD), autism spectrum disorder (ASD), and both ASD and ADHD to reveal potential interactive effects. Methods: A total of 148 boys aged 4-9 years old were enrolled in this study, including 44 children with ADHD, 40 pediatric patients with ASD, 32 patients with both ADHD and ASD, as well as 32 healthy neurotypical children. Hair, serum, and urinary Mg levels were assessed using inductively-coupled plasma mass spectrometry (ICP-MS). Laboratory quality control was performed using certified reference materials of human hair, plasma, and urine. Results: No significant group difference in serum Mg levels was observed. Mg content in hair was found to be reduced in children with ADHD and ADHD+ASD compared to that in healthy controls by 11% and 15%, respectively. Urinary Mg levels in children with ADHD+ASD exceeded the control, ADHD, and ASD values by 51, 76, and 65%, respectively. Factorial analysis revealed significant contribution of ADHD to hair and urinary Mg levels. Multiple regression analysis demonstrated that hair and urinary Mg levels were considered as significant predictors of neurodevelopmental disorder complexity. Conclusion: We propose that impaired Mg status may provide a link between ADHD and ASD.