Background: Information is scarce about biological disease-modifying antirheumatic drug (DMARD) switching patterns in children and young people (aged ≤16 years) with juvenile idiopathic arthritis in an era of many biologic therapies. The best choice of biologic to use if the first biological DMARD is not beneficial also remains unclear. We aimed to quantify and characterise biologic switching patterns in children and young people with juvenile idiopathic arthritis, and to compare the effectiveness of using a second tumour necrosis factor inhibitor (TNFi) versus non-TNF is following failure of a first TNFi biologic in routine clinical practice. Methods: Our study population comprised patients with juvenile idiopathic arthritis who were enrolled in two parallel UK cohort studies (the British Society for Paediatric and Adolescent Rheumatology Etanercept Cohort Study [BSPAR-ETN] and the Biologics for Children with Rheumatic Diseases [BCRD] study) between Jan 1, 2004, and April 11, 2019. Data on disease characteristics and DMARD therapy were collected at the time of initiation of a first biologic, at 6 months, at 1 year, and annually thereafter. Biologic switching patterns were described in all patients who started their first biologic from Jan 1, 2010, onwards. Among patients who started treatment with their first biologic from Jan 1, 2004, onwards, had polyarticular course juvenile idiopathic arthritis (extended oligoarthritis or polyarthritis [positive or negative for rheumatoid factor]), and who had started a second biologic, we assessed changes in outcome variables at 6 months compared with baseline and compared the proportion of patients who achieved an American College of Rheumatology Pediatric (ACR Pedi) 90 response and minimal disease activity at 6 months on the basis of the class of the second biologic (a second TNFi vs non-TNFi biologic). Changes in outcome variables at 6 months were compared using linear regression or logistic regression, adjusted for propensity quintiles to account for confounding by indication. We used multiple imputation to account for missing data. Findings: Between Jan 1, 2004, and April 11, 2019, 2361 patients were enrolled on initiation of biologic therapy. From Jan 1, 2010, onwards, 1152 patients started their first biologic, most of whom started treatment with TNFis (1050 [91%]). The median follow-up was 2·2 years (IQR 1·1–3·8). During this time, 270 (23%) of 1152 patients started a second biologic, 61 (5%) started a third biologic, and 11 (1%) started a fourth biologic. Among 240 patients with polyarticular-course juvenile idiopathic arthritis, 194 (81%) started a second TNFi and 46 (19%) started a non-TNFi after an initial TNFi had failed. Choice of second treatment (second TNFi vs non-TNFi biologic) did not affect the proportion of patients who achieved an ACR Pedi 90 response (adjusted odds ratio [OR] 2·5, 95% CI 0·8–7·9; p=0·11) or minimal disease activity (adjusted OR 1·6, 95% CI 0·6–3·8; p=0·33). Interpretation: For many children and young people with juvenile idiopathic arthritis, treatment with a first or second biologic is not beneficial. We found no evidence that switching to a second non-TNFi biologic was more beneficial than a second TNFi. Funding: Versus Arthritis and The British Society for Rheumatology.