Introduction. The increase in sedentary screen time can negatively affect the quality of sleep, impacting the performance of daily activities. Objective. To analyze the association between sedentary screen time and sleep quality, regardless of the symptoms of anxiety in adolescents of both genders. Method. Cross-sectional study integrating school-based epidemiological research with a representative sample (n = 666) of high school students (14 to 19 years old) in public schools in the municipality of Caruaru-PE. The translated versions into Portuguese of the Pittsburgh Sleep Quality Index (PSQI) and the Hospital Anxiety and Depression Scale (HAD) were applied to analyze sleep quality and anxiety, respectively. Binary logistic regression was used to analyze the association, considering sleep quality as an outcome. Results. There was a positive, statistically significant (p #abr# .001) correlation between sleep quality and symptoms of anxiety (r = .393). A significant association regarding the association between screen time and sleep quality was noted only in those adolescents classified as being possible or probable anxiety cases and only in exposure to the computer (OR = 2.337; 95% CI [1.01, 5.43]) and video games (OR = 8.083; 95% CI [2.0, 32.8]) after adjusting for gender, age, and school shift. Discussion and conclusion. Increased interaction with the screen and higher levels of anxiety can be more harmful to sleep in adolescents. Exposure to screen time, specifically those which have a greater interaction such as video games and computers, can have a negative impact on sleep quality, but only in adolescents with a higher risk of anxiety.