If you’re looking for a job, it turns out that Massachusetts, Washington or Colorado are your best bet — even better than New York or California — when it comes to all the reasons you would want to live and work somewhere.

Massachusetts ranks No. 1 overall thanks to a strong education and health care system, according to a study from personal finance website WalletHub, which gauged 33 indicators of job-market strength, opportunity and economic health. Washington was the overall runner-up at No. 2, while West Virginia came in last.

It’s not just about the job opportunities or compensation. If it were, California may have done better than No. 9, given the formidable job engine that is Silicon Valley. The high cost of living and real estate in the San Francisco Bay Area probably didn’t help.

Massachusetts topped other states because it has a diversity of industries, a strong health care system and top schools, the report stated. “They have an education system that is superior to most in the country and prepares people for those jobs — and a huge health care sector that generates so many jobs,” said Anna Tavis, professor of human capital management at New York University.

There’s a vital connection between a state’s quality of education and how each one ranks, according to the report. Good schools attract students, and many stay after graduation — especially if there’s a wide range of careers they can pursue.

Washington’s biggest strengths? “Economic environment,” in which it was the top-ranked state, and “Highest monthly average starting salaries,” a category in which it landed No. 2, behind Texas.

Charlotte and Austin outrank Seattle in study of best places to work in tech

The states at the bottom don’t suffer so much from a lack of jobs, but rather a lack of quality jobs. Mississippi, Kentucky, Louisiana, Alaska and West Virginia were ranked last because of the large number of positions available in those states that are low-paid, short-term and seasonal.

Tavis predicted that education will continue to be a key factor for determining where future college graduates land. As a result, the divide between coastal and rural states will widen. The green energy and health care sectors, she said, are where most sustainable jobs are going to be created, and they’re going to be closer to where people prepare for those types of jobs.

Seattle Times Explore staff contributed to this report.