More states are requiring students to take a foundational computer science class to graduate—employing a powerful policy lever to bridge long-standing gender, racial, and socioeconomic gaps in course enrollments, concludes Code.org’s annual report on the state of computer science education.
But despite the increase in states requiring foundational computer courses for graduation, those disparities persist nationally, the report found.
“The biggest message is that graduation requirements, they work,” said Hannah Weissman, the senior director of policy for Code.org, a nonprofit that seeks to expand computer science education, including for marginalized student groups. “There’s a lot of great work going on in classrooms across the country, but if there isn’t that requirement for students to take computer science, we’re continuing to miss millions of students, and those students are primarily young women, primarily Hispanic and Latino students, and primarily low income.”
Girls are still less likely than boys to choose foundational computer science courses. About a third of high school students enrolled in such classes are young women, the report found.
And nationally, Hispanic and/or Latino high school students are 1.7 times less likely to take a computer science course than their white and Asian peers.
Overall, about 60 percent of high schools offer foundational computer science courses, up from 57.5 percent last year.
‘Pervasive stereotypes about who is good’ at computer science persist
Back in 2017, just one state—Nevada—had a computer science graduation requirement. In 2024, 10 additional states—Alabama, Arkansas, Indiana, Louisiana, Nebraska, North Carolina, North Dakota, Rhode Island, South Carolina, and Tennessee—have a requirement on the books, up from eight last year.
Three of those states—Alabama, Indiana, and Louisiana—added the requirement just this past year.
The requirement is still being implemented in most of those states, however. Two states—Nevada and South Carolina—required a foundational computer science course for students who graduated in 2023 or 2024. In other states, the requirements won’t kick in until the 2025-26 school year, at the earliest.
Overall, 6.4 percent of high schoolers enrolled in foundational computer science courses during the most recent school year in the 41 states for which data are available. That’s a slight increase from last year when 5.8 percent of students enrolled.
But it’s still far short of 25 percent of students enrolled in foundational computer science courses. That’s what the percentage would be if every student took foundational computer science at some point in their four-year high school career.
Even so, states with a graduation requirement have almost double the percentage of students enrolled in a foundational computer science class, 10.8 percent, compared to 5.2 percent for states without a graduation requirement, according to Code.org.
When states require computer science courses in order to graduate, they’re essentially saying, “let’s give everyone that basic exposure,” Weissman said.
Even though technology is a part of most students’ daily lives, “they still might not actually know what computer science means,” Weissman said. What’s more, “there still are pervasive stereotypes about who is good at it, who isn’t good.”
Students who take a course may be surprised by their interest in, or aptitude for, the subject, she said. “And then careers open up” in fast-growing areas like artificial intelligence and cybersecurity, she added.
“Before the first day of my first computer science class, I didn’t feel confident that I could be good at coding,” said Alexis Oh, a 10th grader in California, in a statement included in the report. “However, I can confidently say that with a great teacher, and supportive friends that share my interests, computer science is my favorite class and has helped me strengthen my creativity and problem solving.”
Gender, race, and income are big factors in who takes the courses
In addition to the gender gap, there are enrollment gaps between different racial groups, as well as between students from low-income families and financially better-off classmates, and English learners and their peers. Similar gaps exist for students in special education compared to those in general education.
- White students make up 45 percent of the total student population and comprise about the same percentage of enrollment in computer science courses.
- Asian students make up about 5 percent of students overall but are overrepresented in foundational computer science courses, where they comprise 13 percent of enrollment.
- Hispanic students, meanwhile, make up 29 percent of the student population, but 20 percent of enrollment in foundational computer science courses.
- Students from low-income families comprise 53 percent of students but make up 38 percent of those in foundational computer science courses.
- English learners are 11 percent of the student population but 7 percent of those in foundational computer sciences classes.
- And while 1 in 6 students has an Individualized Education Plan, one in 10 in foundational computer science courses do.
Notably, Black students are slightly overrepresented in computer science courses. They comprise 15 percent of the student population but make up 17 percent of enrollment in computer science courses.
That may be because some of the states that have embraced expanding computer science enrollment have sizeable Black populations, such as Alabama, Mississippi, and South Carolina, Weissman said.
Even though Black students are overrepresented overall in computer science, there’s still work to do, she added.
“I think it can be easy to see a graph and be like, ‘Oh, we reached parity. We’re done,’” she said. “That data looks different for different states. And so while on a national level, we have closed that participation gap, that is not the case in every state.”
Are elementary and middle school courses a computer science gateway for girls?
Meanwhile, the gender gap in computer science course-taking isn’t nearly as apparent among younger students.
About 8 percent of middle schoolers have taken a foundational computer science class in 31 states for which data are available, the report said. The gender breakdown in middle school is much more even than it is in high school, with girls making up 44 percent of enrollment in computer science classes, compared to 56 percent for boys.
That smaller gap in middle school is to be expected, Weissman said.
In some middle schools, computer science may be an elective, but there tend to be fewer electives for students to choose from than in high school, she added.
But students—including girls—who are exposed to computer science in elementary or middle school may be more likely to continue their studies in high school.
“We are very much expecting to see those positive benefits as we have more kids exposed in elementary school who then take a course in middle school and high school,” Weissman said.