Objectives Juvenile idiopathic arthritis (JIA) is a common chronic childhood disease and chronic pain is a debilitating feature. A strong link has been shown between poor sleep and pain in JIA. However, the causal direction is unknown. This study’s aim was to determine if, in adolescents with JIA, a recommended healthful sleep duration leads to reductions in pain when compared with the restricted sleep (RS) duration that is commonly seen.Methods Patients with JIA (12–18 years old; pain score of ≥1 on a visual analogue scale) participated in a randomised, crossover sleep manipulation protocol. The 3-week protocol comprised a baseline week (BL), a week with healthy sleep duration (HSD; 9.5 hours in bed/night) and a RS week (RS; 6.5 hours in bed/night). After BL, participants were randomly assigned to either HSD or RS, and then crossed over to the other condition. Pain was self-assessed using the iCanCope with Pain app. We used Bayesian hierarchical models to estimate the effect of sleep duration on pain.Results Participants (n=31; mean age=15.0±1.8 years) averaged 1.4 (95% credible interval (CrI) 1.2–1.6) more hours of sleep per night during HSD relative to RS. Compared with RS, HSD resulted in a favourable effect on pain scores (OR 0.61, 95% CrI 0.39–0.95).Conclusion It is possible to have adolescents with childhood arthritis get a healthier sleep duration, and this longer sleep results in reduced pain. These findings complement prior correlational studies and confirm a causal relationship between reduced sleep duration and increased pain.Trial registration number NCT04133662.