Abstract Objectives Classroom time on task (TOT) is positively associated with academic performance. Studies have found a relationship between dietary intake and cognitive performance. This study aimed to examine the association of dietary quality with TOT. Methods Data were obtained from 3rd–5th grade students participating in TX Sprouts—a large, school-based gardening, nutrition, and cooking randomized controlled trial. Measures collected included: height, weight, and body composition via bioelectrical impedance. We assessed dietary intake via two, 24-hr dietary recalls, TOT via four, 15-min direct observations sessions, and dietary quality using the Healthy Eating Index (HEI-2015). On-task behavior was defined as any verbal or physical behavior that followed the classroom rules or followed instructions given by the teacher. Off-task behavior was defined as any actions whereby a student was disengaged or distracted from the assigned task. Multilevel mixed-effects modeling was used to determine the association of HEI on TOT, controlling for school, class, sex, grade level, child ethnicity/race, BMI category, economically disadvantage status, and day of the week. Results The analytic sample was comprised of 478 participants (mean age 9.4 years; 53.0% male; 59.2% Hispanic; 54.2% normal weight; 64.5% FRL). Students with higher TOT scores consumed more total vegetables (b = 1.60, SE = 0.35, P < 0.01), more seafood and plant proteins (b = 0.85, SE = 0.26, P < 0.01), and more fatty acids (b = 0.72, SE = 0.17, P < 0.01) when compared to their counterparts. Similarly, those with higher TOT scores consumed less sodium (b = 0.55, SE = 0.16, P < 0.01), less refined grains (b = 0.32, SE = 0.14, P < 0.05), less added sugar (b = 1.15, SE = 0.19, P < 0.01), and less saturated fats (b = 0.35, SE = 0.15, P < 0.05) when compared to other students. Conclusions Findings suggest a link between dietary quality and TOT in 3rd–5th grade students. Small incremental changes in dietary quality could have implications for increased academic achievement and cognitive performance in low-income, 3rd–5th grade students. Funding Sources Supported by National Heart, Lung, and Blood Institute grant R01HL123865.