New Jersey’s public schools are among the nation’s best, according to the newest Quality Counts ranking of the nation’s schools.

New Jersey received a ‘B’ on the Quality Counts report, produced by Editorial Projects in Education, the publisher of Education Week. Only Massachusetts, which received a ‘B-plus’ was ranked higher. The study was released last week.

The grades are based on ratings in three major categories: Chance for success, school finance analysis and K-12 achievement.

Category by category, New Jersey’s public schools scored as follows:

Chance for success: B-plus

This index considers thirteen indicators of success, such as preschool enrollment rate, post-secondary participation, and adult income. One negative for the Garden State was, the state ranked 31st in the country for “steady employment,” a measure of adults working full-time and year-round in 2014.

School finance: B

New Jersey ranked sixth-best grade in America, and it finished second in the country in K-12 education spending as a percent of state taxable resources. However, New Jersey received a low ranking for equity. Its difference in per-pupil spending between the 95th and 5th percentiles was 47th in the country.

K-12 achievement: B-minus

New Jersey ranked second overall in K-12 achievement, based on scores from national tests taken in 2015 and historical data dating to 2003.

It had the fourth-highest 2015 scores in eighth-grade math on the National Assessment of Educational Progress. New Jersey students from low-income families struggled on the exam, however, according to published reports. The state’s poverty gap on that test ranked 49th.

NJSBA Executive Director Dr. Lawrence S. Feinsod said the Quality Counts ranking solidifies New Jersey’s position as one of the nation’s strongest school systems, and the fact that the state’s schools and districts are continually working to improve.

“Student achievement is what our schools stand for, and it is what drives our work at NJSBA,” Feinsod said. “We welcome these rankings as part of the continuous conversation and effort to help every New Jersey student reach his or her full potential.”