A new ranking by WalletHub tackles the question of which states offer the best environments for raising a family.

In a wide-ranging study that looked at everything from healthy services, to entertainment, to education and salaries, the personal finance website noted that there are many factors that families will want to consider when choosing a state to live in.

"Raising a healthy, stable family sometimes requires moving to a new state," WalletHub said in the report. "The reasons people choose to move are often similar: career transitions, better schools, financial challenges or a general desire to change settings. Wants and needs don’t always align in a particular state, though."

The study compared 50 states across 51 key indicators of family-friendliness, grouped into four main categories: family fun, health and safety, education and childcare and affordability, WalletHub said.

The following states, in ascending order, were ranked the highest for family living:

10. New Jersey

The Garden State scored the highest in the nation in the category of education and childcare. The state also had the third-highest median family salary and the third-lowest divorce and separation rate.

 

9. North Dakota

The state ranked third in the nation for education and childcare. It was also ranked third for home affordability, second for divorce and separation rate and fourth for lowest percentage of families living in poverty.

 

8. Washington

The state ranked third in the nation for affordability and eighth for family fun.

 

7. Connecticut

The state ranked first in the nation for family fun and fourth for the fewest violent crimes per capita.

 

6. New Hampshire

New Hampshire has the lowest percentage of families living in poverty of all U.S. states. It also ranks second for lowest infant mortality and second for fewest violent crimes per capita.

 

5. Nebraska

The state has the second-most affordable housing in the nation. It also ranks fourth for having the most families with young kids.

 

4. Minnesota

Minnesota has the highest median family salary in the nation. It also has the second-lowest family poverty rate and ranks fifth for lowest divorce and separation rate.

 

3. Vermont

Vermont is the top-ranked state for health and safety. It has the nation's lowest infant mortality rate and the third-lowest rate of violent crimes per capita.

 

2. New York

New York and the state ranked above it were the only states in the top 10 of all categories studied. It ranked second for family fun and fifth for education and childcare.

 

1. Massachusetts

Massachusetts was in the top 10 of all categories, ranking second for education and childcare, second for affordability and third for health and safety. The state has the nation's third-lowest infant mortality rate.

The full report can be viewed here.