New York City’s small but growing opt-out movement took hold in all five boroughs this year, with groups of students refusing to take state exams in more than 160 schools, according to city data released Wednesday.

More than 7,900 students across the city opted out of at least one of the exams, which cover math and English and are given to students in grades three to eight, according to the city education department. While the boycotters represented less than 2 percent of all eligible test takers, their numbers have more than tripled since last year.

Still, the city’s corps of boycotters was dwarfed by the state’s: About one in five New York students — or roughly 200,000 students out of 1.1 million eligible test takers — refused to take the exams this April, state education officials said.

Top education officials on Wednesday defended the state’s challenging Common Core learning standards and the annual assessments tied to them, despite the unprecedented show of defiance by parents and students, who were backed by many sympathetic educators and openly encouraged by the state teachers union. They also held out the threat that districts and schools with high opt-out numbers could lose federal funding.

State Education Commissioner MaryEllen Elia said her agency would consider the public’s concerns, but insisted that the state would be “moving forward with higher standards” and suggested that parents and teachers who support opting out may not grasp the importance of the standards and tests.

“Perhaps there hasn’t been enough information out not only to parents, but perhaps to our own educators on how they can effectively use this information,” she said on a conference call with reporters, referring to the test results.

Parent opposition to testing had been growing but caught fire in 2013 when more difficult Common Core-aligned exams brought students’ scores crashing down, and has been fueled by educators who object to being rated based on those scores. While hostility to the tests is still most widespread in progressive-minded parts of Brooklyn and Manhattan with many higher-income families, students in dozens of schools beyond those opt-out hotspots joined in this year, the data shows.

About 600 students across 25 schools in the Bronx boycotted the math exams, as did about 450 students in more than a dozen Staten Island schools, according to the city. Those figures only include students in schools where 10 or more students who opted out, meaning that the total opt-out counts are probably slightly higher. About half as many students in each borough skipped the English exams. (Citywide, about 1,750 more students opted out of the math tests than English, which could be because the math tests were administered later, giving the boycott more time to simmer.)

[See what schools and districts had the most students opt out of the exams here.]

Still, Brooklyn had the most students opt out, with seven of the 10 schools with the most boycotters based in that borough. Brooklyn’s District 15, which includes Park Slope, saw at least 1,450 students sit out the English exams and 1,660 skip math — far more than any other city district. Statewide, students who opted out were more likely to be white and from wealthier districts, and to have earned non-passing scores on last year’s exams if they took them, officials said.

Nancy Cauthen, a member of the opt-out group Change the Stakes, said that many parents outside the usual anti-testing districts are unaware that they can keep their students from taking the exams, or have faced pressure not to from school administrators worried about the possible impact on their school’s ratings and funding. Still, she said more parents from such districts contacted her group this year asking its members to speak at opt-out informational meetings.

“We had more members doing presentations in Spanish, going to a wider range of schools in terms of income levels,” said Cauthen, whose son skipped this year’s exams at P.S./I.S. 187 in Washington Heights.

Even as the opt-out movement creeps into more corners of the city, the figures released Wednesday also highlighted the relatively small size of the city’s opt-out movement compared to those in many other districts across New York.

Opt-out advocates cite many reasons: the city has many high-need schools where staff and parents may worry about losing federal funding; unlike other districts, student promotion to the next grade was long tied to test scores, and certain middle and high schools still consider scores in admissions; and, in contrast to the state teachers union, the city union did not endorse opting out.

Mayor Bill de Blasio gave his own explanation Wednesday, saying that parents were encouraged last year when the city changed the promotion policy to include other measures of student progress besides just test scores. While city schools Chancellor Carmen Fariña has instructed principals to respect the will of parents, she also said bluntly Wednesday: “I don’t believe in opt-out. I believe that everyone needs to be assessed.”

It was still not clear Wednesday what penalties, if any, city schools with many test refusers might face.

Federal rules require at least 95 percent of students in tested grades to take the annual exams, and say that districts could lose some federal funding if they repeatedly fail to get their schools to meet that threshold. A U.S. education department spokeswoman said Wednesday that it is the state’s responsibility to impose sanctions on districts. But a spokesman for the state agency said federal officials were the ones considering penalizing schools and districts, which the state believes “would be wrong to do.”

Commissioner Elia said she has had several conversations on this matter with federal officials, who suggested that they could reduce funding for districts with low test-participation rates.

“That is an option they have,” she told reporters, “but they have not indicated whether they’re doing that or not.”

If any teachers had fewer than 16 students take the tests, then alternative measures of student learning would be substituted for test scores in their evaluations, state officials said.

Jia Lee, a teacher at the Earth School in Manhattan where more than 100 students boycotted the exams, said the city’s expanding opt-out movement reflects a “growing ground-up awareness of parents, teachers and students who don’t want to be evaluated based on an invalid metric.”