MINNEAPOLIS (WCCO) — A new study is finding Minnesota and Wisconsin have some of the best schools in the country.

According to a new report from data-crunching website WalletHub, Minnesota ranks seventh in an analysis of schools in all 50 states and the District of Columbia. The analysis factors in school performance, safety, funding, class size, instructor credentials and 16 other data points on schools in each state.

READ MORE: 12-Year-Old Hurt In St. Paul Shooting; Investigation Underway

Soaring to the top of the list is Massachusetts, with a score of 78.16 — far above second-place New Jersey, which scored 66.92. New Hampshire comes in at No. 3 with a score of 64.65, just barely beating out Wisconsin in fourth with 64.25.

READ MORE: 5 People Injured In House Explosion In Cambridge

Both Wisconsin and Minnesota appear in a few more places in the study. Minnesota is ranked second for highest math test scores. Wisconsin is tied with Illinois and Missouri for highest SAT scores, with Minnesota just behind. Wisconsin is also No. 2 in lowest percentage of threatened or injured high school students, behind Massachusetts.

MORE NEWS: ‘We’re Making Some Adjustments’: Worker Shortage Has Metro Transit Pushing Light Rail Service To Every 12 Minutes

You can read the full study, and about their methodology, here.