Juvenile idiopathic arthritis (JIA) is a chronic rheumatic disease that causes joint inflammation and pain. Previous studies have indicated affected mental health and increased risk of psychiatric conditions among patients with JIA. We aimed to explore differences in psychiatric morbidity between children with JIA and their peers. We further studied if parental socioeconomic status (SES) influences the association between JIA and the risk of psychiatric morbidity. We used a matched cohort design to estimate the association between JIA and psychiatric disease. Children with JIA, born between 1995 and 2014, were identified in Danish national registers. Based on birth registers, we randomly selected 100 age- and sex-matched children per index child. Index date was the date of the fifth JIA diagnosis code or the date of matching for reference children. End of follow-up was the date of psychiatric diagnosis, death, emigration, or December 31, 2018, whatever came first. Data were analyzed using a Cox proportional hazard model. We identified 2086 children with JIA with a mean age at diagnosis of 8.1 years. Children with JIA had a 17% higher instantaneous risk of a psychiatric diagnosis when compared with the reference group, with an adjusted hazard ratio of 1.17 (95% CI 1.02-1.34). Relevant associations were found only for depression and adjustment disorders. Stratifying our analysis for SES showed no modifying effect of SES. Children with JIA had a higher risk of psychiatric diagnoses compared to their peers, especially diagnoses of depression and adjustment disorders. The association between JIA and psychiatric disease did not depend on parental SES.