Massachusetts has the best public education system out of all US states, according to an annual ranking.

The US News and World Report rankings looked at how well states are educating their students in preschool, K-12 and higher education.

It examines performance in areas like preschool enrollment, math and reading scores, college readiness, graduation rates, tuition and fees, and debt at graduation.

Visit INSIDER's homepage for more stories

Massachusetts was ranked as having the best public education system out of all US states, according to an annual ranking.

The US News and World Report rankings looked at how well states are educating their students in preschool, K-12 and higher education after examining areas like preschool enrollment, math and reading scores, college readiness, graduation rates, tuition and fees, and debt at graduation.

While Massachusetts topped the list, Alabama and New Mexico ranked the lowest.

The rankings come as part of US News and World Report's "Best States" ranking for 2019, which looks at the quality of health care, education, and infrastructure in every state, as well as their economies and quality of life.

Here are the states ranked in order of the quality of their public education systems: