This research examined the age- and sex-specific incidence rates and cumulative incidences of the risks of being diagnosed with any mental disorder during childhood and adolescence. In this nationwide cohort study the risk (cumulative incidence) of being diagnosed with a mental disorder before 18 years of age was 14.63% in girls and 15.51% in boys. Distinct age- and sex-specific patterns of occurrence were found across mental disorders in children and adolescents. Anxiety disorder was the most common diagnosis in girls, while attention-deficit/hyperactivity disorder (ADHD) was the most common in boys. Girls had a higher risk than boys of schizophrenia, obsessive-compulsive disorder and mood disorders. The overall risk of being diagnosed with a mental disorder before 6 years of age was 2.13% and was higher in boys than in girls.