IntroductionIn recent years, there has been a growing global concern about the physical and mental health of adolescents. As a core component of well-being, sleep has increasingly drawn attention from both the academic community and policymakers. Educational and health authorities in several countries have issued reports highlighting the widespread issue of insufficient sleep among adolescents1,2. Despite its vital importance, research indicates that students across all educational levels are experiencing reduced sleep duration3,4. Particularly in the context of increasing academic pressure, reduced sleep duration has become an important factor affecting adolescents’ physical and mental health and academic performance5,6,7,8. Sleep is essential for maintaining cognitive function, emotional regulation, and physical health. Sufficient sleep not only facilitates brain processes that consolidate and integrate memory but is also crucial for executive functions such as attention, working memory, and problem-solving abilities9,10,11. This is especially important for the middle school population, which is under a lot of academic pressure12. However, the average amount of sleep for adolescents is decreasing globally as the burden of schooling increases13,14. Particularly in Asian countries, influenced by Confucian culture, academic achievement is seen as an important measure of individual and family success15,16, which result in students in countries such as China investing more time in academic competition, compressing necessary sleep time15,16.Given the established consensus that adolescents should sleep between 8 to 10 per night,this study does not aim to determine a universal optimal sleep duration. Instead, it seeks to provide a more nuanced understanding of how sleep duration relates to academic performance across different subjects and among different student groups. Using large-scale, standardized data from eighth-grade students in Shanghai, this study investigates the non-linear associations between sleep duration and subject-specific academic outcomes. It further explores how these relationships vary across academic performance levels and gender, and examines how homework time and electronic device use influence students’ sleep duration. By combining objective test scores, self-reported behavior, and demographic background, this research aims to offer subject-specific, evidence-based insights to improve adolescent sleep health and academic achievement within a high-pressure education system.Sleep duration is defined as the number of hours of sleep per night5, and it has been widely recognized as a crucial factor influencing adolescents’ physical and mental health, cognitive development, and emotional stability6. According to the National Sleep Foundation’s recommendations, children aged 6−13 years should ideally sleep 9–11 h and adolescents aged 14−17 years should ideally sleep 8−10 h17. The American Academy of Sleep Medicine recommends that adolescents get 8 to 10 h of sleep per night, but nearly 40% of adolescents in the United States report getting 10 h dropped to 482 on average.Fig. 1: Student numbers and academic performance corresponding to different sleep duration.This figure illustrates the distribution of sleep duration and mathematics scores within the mathematics sample. Sleep duration is divided into six self-reported categories: 10 h. The left y-axis represents mathematics scores standardized to a mean of 500 and a standard deviation of 100, while the right y-axis indicates the number of students in each sleep category.Full size imageTable 1 presents the differences in sleep duration and academic performance across student background characteristics, including gender, urban-rural classification, local residency status, and school type. Analyses for other subjects (Chinese, English, science, and arts) are provided in Supplementary Information.Table 1 Differences in sleep duration and academic performance among students from different backgroundsFull size tableIn terms of gender, boys reported significantly longer sleep duration than girls (T = 5.616, p