New Jersey is generally a safe place to live. That is, if you have the money.

A wide-ranging stuudy by personal finance company WalletHub ranks the Garden State as the 18th safest state in the nation. Weighing down the score are the finances of state residents.

To arrive at its ranking, WalletHub used 48 criteria that included not only crime and drug rates but also road and workplace safety, emergency preparedness and financial security.

New Jersey received its lowest score in the Financial Safety category, placing at a lowly 37th.

“Most of it has to do with savings,” said WalletHub analyst Jill Gonzalez. There are “not a lot of households with emergency funds or saving money for children’s colleges.”

Several states in the northeast — Vermont, Maine, New Hampshire, Connecticut, Rhode Island, Massachusetts — outperformed New Jersey in this category, and all placed in the overall top 10.

The northeast is the safest region of the country overall, which Gonzalez attributes largely to its financial stability.

She added, however, that “drug abuse in some of these (northeast) states has certainly spiked. The opioid epidemic (has) certainly reached a few of those states, but for the most part, (they are) safer places to be.”

New Jersey performed better in Road Safety, tying for fourth in Fewest Fatalities per 100 Million Miles of Driving. A caveat to this is that New Jersey is also one of the priciest states when it comes to driving, so it came in 18th in overall Driver Safety.

“When you’re looking at insurance premiums and adding a driver to your insurance premiums, New Jersey is one of the most expensive states in the country,” Gonzalez said.

New Jersey also did well in the category of Fatal Occupational Injuries per Total Workers, tying for the fourth lowest rate. Gonzalez said this could be a result of New Jersey having a higher concentration of jobs in the STEM industries — science, technology, engineering and math — which have fewer physical risks.

New Jersey was near the middle of the pack in Emergency Preparedness, which measures the costs of billion-dollar climate disasters since 1980.

New Jersey's geographic location does not make it as vulnerable to natural disasters as states in other regions. The worst five states in this category were all located near the Gulf of Mexico. Relatively recent disasters like Superstorm Sandy, though, brought New Jersey’s score down to 27th, with nearby states Pennsylvania and New York achieving similar scores.