Massachusetts has been ranked as having the best public schools in the country, according to a new study.
Students in the Bay State from elementary to high school were found to have the best test scores for reading and math exams as well as college-level AP exams.
It was followed by three east coast states including Connecticut, Maryland, New Jersey. Wisconsin ranked fifth.
WalletHub's analysis ranked schools in all 50 states and Washington DC for quality and safety using 32 metrics.
Some of the most highly weighted factors included student performance, school funding, number of school shootings, rates of bullying, class sizes and teacher credentials.
Pictured: Fairhaven High School in Massachusetts. The main building is nicknamed the 'Castle on a Hill,' and the public school is ranked as an 'above average' institution by school reviewing site Niche
Its findings showed that Massachusetts spends $21,906 per pupil - the fifth most in the country.
Massachusetts schools were also the second safest, with Delaware schools taking the gold on that metric.
Connecticut schools were the second best, boasting the best ACT test scores in the country and shining when it came to safety measures.
One of the most horrific school shootings in US history happened in 2012 at Sandy Hook Elementary in Newtown, Connecticut, where a 20-year-old gunman shot and killed 26 people. Some 20 of the victims were children between the ages of six and seven years old.
Since then, schools in the state have been required to file annual two-page reports on lockdown drill procedures.
WalletHub claims only 16 other states take similar precautions.
Pictured: New Canaan High School is one of Connecticut's top ranked public schools
Pictured: Poolesville High School is the best high school in Maryland, with the vast majority of its students being proficient in math and reading
Connecticut schools have the lowest prevalence of illegal drugs, the third lowest youth incarceration rate and the sixth lowest number of students carrying weapons on campus, all of which factored into its high safety score.
Maryland, New Jersey and Wisconsin rounded out the top five states for education.
However, Maryland was ranked far safer than schools in New Jersey and Wisconsin, both of which scored in the middle of the pack.
Maryland was also lauded for its commitment to making sure lessons are accessible for all students.
The state passed an amendment to its education code in 2022 that requires schools to ensure students with disabilities have equal access to 'digital tools,' which were defined as online platforms and courses.
The Northern Valley Regional High School District is in Demarest, New Jersey, a small suburban town near New York City. The district gets great teacher ratings and focuses heavily on college prep
The amendment also looks out for blind children, mandating that keyboard controls for them are fitted with options for Braille or spoken inputs.
The law went into effect on October 1, 2023.
The states with the worst public schools had the highest dropout rates, poor test scores, high percentages of students getting threatened or injured on school grounds and frequent bullying.
Occupying the bottom five were Louisiana, Alaska, Arizona, Oklahoma and New Mexico.
Idaho, Alaska, Arizona, New Mexico and the District of Columbia were tied for the 47th worst in the nation for high school graduation rates.