Whether you’re thinking about starting a family, or you already have kids, you might be wondering about the best place to put down roots. Factors like the housing market, school system, career opportunities, and safety are incredibly important when it comes to deciding where you’re going to start your family life, but that data can be difficult to track down. Luckily, WalletHub has done the work for you. It compared all 50 states to show you the best (and worst) places to raise your kids.

The darker the state, the better the ranking. (Map: WalletHub)

The list was compiled using a variety of criteria, including family fun, health and safety, education and child care, affordability, and socio-economic factors. These categories were broken down into weighted metrics, graded on a 100-point scale, and then combined into an overall score.

Photo: WalletHub

According to the list, Minnesota is the best place in the US to raise kids, with a 65.32 point rating, followed by Massachusetts, North Dakota, Vermont, and New Hampshire. On the flip side, New Mexico is considered to be the worst, with a rating of 31.69, followed by Mississippi, Louisiana, West Virginia, and Alabama.

H/T: Thrillist