A record number of New York City students took the SAT last spring thanks to a new initiative that allows all high-school juniors to take the exam for free during the school day.

Nearly 78 percent of last year’s 11th-graders had taken the test at least once during high school — a 25 percentage point increase over the previous year’s cohort, according to education department data released Thursday.

The $2.2 million-per-year initiative is designed to get more low-income students to take the test, which most selective colleges require applicants to take. (The ACT is another option.) Known as “SAT School Day,” it frees up students from having to sign up for the test, pay the $46 fee or request a waiver, and travel to a testing site on a Saturday, when the test is normally given.

“With more NYC students taking the SAT than ever before, our efforts to eliminate any barriers on any child’s path to college and careers are working,” Mayor Bill de Blasio said in a statement.

While taking the SAT is often the first step in applying to college, it does not guarantee students will end up there. In 2016, just under 60 percent of New York City students enrolled in college or other post-secondary programs after high school.

The city’s SAT program significantly boosted the number of juniors who have taken the test at least once: Last year, 61,800 had, up from about 40,800 in 2016. In addition, the gap in participation rates between white and Asian students and their black and Hispanic peers grew smaller.

However, large racial gaps persist when it comes to students’ SAT scores. For instance, among last year’s 11th-graders, white students on average scored 100 points higher than black students and 94 points higher than Hispanics on the math portion of the test, which is scored on a 200 to 800-point scale. Asian students, on average, scored 40 points higher than whites in math.

On average, New York City students last year scored below a level in math that indicates they’re prepared for college-level work. But they surpassed that “college-ready” benchmark in reading and writing.

Juniors averaged 494 in math, while seniors averaged 499. A score of 530 in math is considered college-ready, meaning it predicts with 75 percent likelihood that a student will earn at least a C in their first-semester college course in that subject, according to the College Board, the nonprofit that controls the SAT.

In reading and writing, the average was 490 among juniors and 498 for seniors. The college-ready cutoff is 480. Incoming students at the City University of New York who don’t reach that benchmark must take remedial classes.

The city’s in-school SAT initiative began as a pilot program in 2015 and expanded to all high schools last spring. It is part of de Blasio’s “College Access for All” initiative, which also aims in the coming years for every middle-school student to go on a college visit and every high-school student to graduate with a personalized college-and-career plan.