The city has raised $20 million to spread computer science education across New York City, reaching the halfway mark of its private fundraising goal, Mayor Bill de Blasio announced Thursday.

The mayor’s “Computer Science for All” program is one his flashiest education initiatives. It’s a pledge to give all of New York City’s 1.1 million public school students access to computer science education in elementary, middle and high school by 2025.

When the initiative was announced last year, it faced several obstacles. Chief among them were fundraising and recruiting enough computer science teachers. On Thursday, de Blasio sought to assuage both of these concerns and argued the program is on track to reach every nook and cranny of the city.

“We would never accept the notion that some kids get to learn math and other don’t. Some kids get to learn the alphabet and others don’t,” said de Blasio at the Laboratory School of Finance and Technology in the Bronx. “But let’s face it. It was a norm that computer science education was, in many ways, considered an elite activity. We have to break through that.”

Last September, de Blasio had raised only about 30 percent of the $40 million in private funds necessary to bring computer science to every school in the city. Today, the mayor reported that number has risen by $9 million, including a $2.5 million donation by Math for America, a group that gives fellowships to STEM teachers so they can share their knowledge and skills with others.

The sizable spike puts the program’s private funding “well ahead of schedule,” de Blasio said after sitting in on a class at the school, which recently added AP computer science.

The city has trained 450 teachers so far, de Blasio said, but there is much work to do before the city reaches its 5,000 teacher goal.

Reaching that many educators is also a matter of funding, said Fred Wilson, the founder of New York City Foundation for Computer Science Education and a driving force behind the city’s “Computer Science for All” initiative.

“The issue is not getting the teachers excited to do it. I think the issue is having the funding to be able to pay for the professional development,” Wilson said. “The demand is there, we’ve just got to supply it.”

Other schools may face a lack of technology infrastructure, such as inadequate Wi-Fi. City officials said that in addition to private money, the program will leverage substantial public funds. Some of that public money will go toward making sure schools have the proper infrastructure and hardware, they said.

In all, 246 schools are involved in the program this year. That includes a broad range of efforts that fall under the city’s computer science umbrella. Some schools have new, large-scale computer science programs, like AP computer science or the city’s multi-year Software Engineering Program. Others have smaller-scale efforts, such as trained teachers who will integrate computer science lessons into typical school days.

Despite de Blasio’s assertion that progress is moving rapidly, earlier in the day City Comptroller Scott Stringer criticized the initiative for its decade-long timeframe for implementation.

De Blasio rejected Stringer’s logic on Thursday, arguing that producing a quality, effective program takes years.

“The reality is, it takes tremendous effort to prepare something that’s going to reach every single one of those children,” de Blasio said.