Pediatric obesity is associated with impaired cognitive function; however, the mechanisms underlying this association demand assessment. Sleep may be a relevant moderator, as poor sleep predicts both increased adiposity and impaired cognitive function. To determine the effects of adiposity and sleep on adolescent cognitive function. This single-blind randomized crossover trial was conducted from September 2020 to October 2022. Parents or caregivers provided demographic information for adolescent participants. Body mass index percentile and bioelectrical impedance analysis assessed adiposity. Adolescents completed 2 actigraphy-confirmed sleep conditions, adequate and restricted, followed by in-person cognitive assessment. No additional follow-up was provided. Data collection for this population-based study took place in a behavioral medicine clinic in Birmingham, Alabama. A total of 323 participants were assessed for eligibility (ages 14-19 years and healthy). Of the 244 eligible adolescents, 157 declined participation. Eighty-seven were randomized and 26 dropped out postenrollment. The final sample included 61 adolescents, 31 with healthy weight and 30 with overweight or obesity. Data were analyzed from April to October 2023. Following a 2-day washout period of adequate sleep, adolescents completed 2 sleep conditions: adequate (mean [SD] duration, 8 hours, 54 minutes [58.0 minutes]) and restricted (mean [SD] duration, 4 hours, 12 minutes [50.7 minutes]). The National Institutes of Health Cognitive Toolbox assessed global and fluid cognition, cognitive flexibility, working and episodic memory, attention, and processing speed. The Stroop Task assessed inhibition. The final sample included 61 adolescents (mean [SD] age, 16.3 [1.6] years; 35 [57.4%] female). Restricted sleep predicted poorer global cognition scores (restricted mean [SD], 98.0 [2.8]; adequate mean [SD], 103.2 [2.9]), fluid cognition scores (restricted mean [SD], 94.5 [3.2]; adequate mean [SD], 102.0 [3.6]), and cognitive flexibility scores (restricted mean [SD], 84.8 [3.0]; adequate mean [SD], 92.8 [3.0]) for adolescents with overweight or obesity. No differences emerged for adolescents with healthy weight. Adolescents with overweight or obesity also had poorer attention scores (mean [SD], 80.0 [2.3]) compared to adolescents with healthy weight (mean [SD], 88.4 [SD, 2.3]) following restricted sleep. No differences emerged following adequate sleep. Findings were similar for total body fat percentage (TBF%); however, for adolescents with TBF% above 42, restricted sleep also predicted poorer processing speed, and the association between sleep and attention did not vary based on TBF%. Adolescents with overweight or obesity may be more vulnerable to negative cognitive effects following sleep restriction. Improved sleep hygiene and duration in this group may positively impact their cognitive health. ClinicalTrials.gov Identifier: NCT04346433.