How well run are America’s 50 states? The answer depends a lot on where you live.

Every year, 24/7 Wall St. conducts an extensive survey of all fifty states in America. Based on a review of data on financial health, standard of living and government services by state we determine how well each state is managed. For the first time, North Dakota is the best run. California is the worst run for the second year in a row.

The successful management of a state is difficult to measure. Factors that affect its finances and population may be the result of decisions made years ago. A state’s difficulties can be caused by poor governance or by external factors, such as extreme weather.

A state with abundant natural resources should have an easier time balancing its budget than one starved for resources. Regional problems or the national decline of certain industries can destroy local economies. The subprime mortgage crisis, for example, disproportionately affected states with strong construction and real estate markets. Such factors can be easily identified and noted as possible causes for a state’s poverty levels, unemployment, or strained coffers.

Despite this, it is the responsibility of each state to deal with the resources at its disposal. Each government must anticipate economic shifts and diversify its industries and attract new business. A state should be able to raise enough revenue to ensure the safety of its citizens and minimize hardship without spending more than it can prudently afford. Some states have historically done this much better than others.

To determine how well the states are run, 24/7 Wall St. reviewed hundreds of data sets from dozens of sources. We looked at each state’s debt, revenue, expenditure and deficit to determine how well it is managed fiscally. We reviewed taxes, exports, and GDP growth, including a breakdown by sector, to identify how each state is managing its resources. We looked at poverty, income, unemployment, high school graduation, violent crime and foreclosure rates to measure if residents are prospering.

The best-run states have certain characteristics in common, as do the worst run. The high-ranking states all have well-managed budgets. Each of the top ten has a perfect, or near-perfect, credit rating from Standard & Poor’s, Moody’s, or both. Of the ten worst-ranked, only three received top scores from one agency, and none from both. California is currently the only state rated A- by S&P, the lowest score given to any state. These poor-ranked states have high debt relative to both income and expenditure.

There is a strong correlation between well-educated populations and generally well-managed states. Of the ten best-scoring states on our list, nine have among the highest percentages of adults with high school diplomas.

Employment is also closely correlated to how well a state is managed. The unemployment rates of most of the poorly ranked states are among the highest in the country. Nine of the ten best-ranked states had an unemployment rate of less than 7% in 2011. This includes North Dakota, which had the lowest rate in the country in 2011, at just 3.6%. The average unemployment rate nationwide was 8.9% in 2011.

For the first time, North Dakota ranks as the best run state in the country. In recent years, North Dakota’s oil boom has transformed its economy. Last year, crude oil production rose 35%. As of August, 2012, it was the second-largest oil producer in the country. This was due to the use of hydraulic fracturing in the state’s Bakken shale formation. The oil and gas boom brought jobs to North Dakota, which had the nation’s lowest unemployment rate in 2011 at 3.5%, and economic growth. Between 2010 and 2011, North Dakota’s GDP jumped 7.6%, by far the largest increase in the nation. This growth has also increased home values, which rose a nation-leading 29% between 2006 and 2011. North Dakota and Montana are the only two states that have not reported a budget shortfall since fiscal 2009.

Wyoming is not the best-run state in the nation this year. The drop is largely due to the state’s contracting economy. In 2011, GDP shrunk by 1.2%, more than any other state. As a whole, however, the state is a model of good management and a prospering population. The state is particularly efficient at managing its debt, owing the equivalent of just 20.4% of annual revenue in fiscal 2010. Wyoming also has a tax structure that, according to the Tax Foundation, is the nation’s most-favorable for businesses — it does not have any corporate income taxes. The state has experienced an energy boom in recent years. The mining industry, which includes oil and gas extracting, accounted for 29.4% of the state’s GDP in 2011 alone, more than in any other state. As of last year, Wyoming’s poverty, home foreclosure, and unemployment rates were all among the lowest in the nation.

Last year, Nebraska had the second-lowest unemployment rate in the nation at 4.4%. In Lincoln, the state capital, the unemployment rate was 4%, lower than all metropolitan areas in the country, except Bismarck and Fargo in North Dakota. Although far from the nation’s wealthiest state — median income was slightly lower than the U.S. median of $50,502 — Nebraska’s economy is strong relative to the rest of the U.S. The state is one of the leading agricultural producers, with the sector accounting for 8.3% of the state’s GDP last year. The state also had the second-lowest debt per capita in the country in fiscal 2010, at $1,279, compared to an average of $3,614 for states nationwide.

In fiscal 2011, Utah had a budget deficit of $700 million, equal to 14.7% of the state’s GDP. This debt-to-GDP ratio is worse than half the states in the U.S. Despite these problems, Utah has committed to reducing expenses in place of raising taxes or increasing debt. The state has also limited its borrowing. Its total debt was just under $6.5 billion in fiscal 2010, or $2,356 per capita — less than most states — and 40.4% of 2010 tax revenue. Both Moody’s and S&P gave Utah their highest credit ratings because of the state’s strong fiscal management. Moody’s commented that Utah has a “tradition of conservative fiscal management; rebuilding of budgetary reserves after their use in the recession; [and] a closely managed debt portfolio.”

Like many of the other well-run states, Iowa is one of the nation’s top agricultural centers — the industry accounted for 6.6% of the state’s GDP in 2011. The farm economy has contributed significantly to growth, with farm earnings rising rapidly and land values skyrocketing. State GDP rose by 1.9% between 2010 and 2011 — the 12th-highest increase in the country. Iowa’s unemployment rate fell from 6.3% in 2010 to just 5.9% in 2011, the nation’s sixth-lowest rate. The state has carried a low debt burden in recent years, averaging just $1,690 per capita in fiscal 2010, among the nation’s lowest. The state currently has the best possible credit ratings both from Moody’s and S&P.

California is 24/7 Wall St.’s “Worst Run State” for the second year in a row. Due to high levels of debt, the state’s S&P credit rating is the worst of all states, while its Moody’s credit rating is the second-worst. Much of California’s fiscal woes involve the economic downturn. Home prices plunged by 33.6% between 2006 and 2011, worse than all states except for three. The state’s foreclosure rate and unemployment rate were the third- and second-highest in the country, respectively. But efforts to get finances on track are moving forward. State voters passed a ballot initiative to raise sales taxes as well as income taxes for people who make at least $250,000 a year. While median income is the 10th-highest in the country, the state also has one of the highest tax burdens on income. According to the Tax Foundation, the state also has the third-worst business tax climate in the country.

Rhode Island’s finances were a mess in fiscal 2010. The state had $9.5 billion in unpaid debts, which came to 107.2% of that year’s revenues.At more than $9,000 per person, it’s one of the largest debt burdens in the country. The state also funded less than half of its pension obligations, worse than all states except for Illinois. In 2010, in a spectacular example of fiscal mismanagement, the state guaranteed a $75 million loan to a video game company, which has since defaulted. With one of the nation’s slowest growth rates and the third-highest unemployment rate in the U.S., at 11.3%, Rhode Island’s economy performed poorly overall.

Although many states have budget issues, Illinois’ faces among the biggest problems. In 2010, the state’s budget shortfall was more than 40% of its general fund, the second-highest of any state. Both S&P and Moody’s gave Illinois credit ratings that were the second-worst of all states. In addition, the state only funded 45% of its pension liability in 2010, the lowest percentage of any state. Governor Patrick Quinn has made the now-$85 billion pension gap a top priority for the new legislative session beginning in January.

Between 2006 and 2011, the value of homes in Arizona tumbled by 35%, more than every state except for Nevada. The state also had the nation’s second-highest foreclosure rate in 2011, with one in every 24 homes in foreclosure. In the aftermath of the financial crisis, Arizona had some of the nation’s largest budget shortfalls. In fiscal 2010, the state had a shortfall of $5.1 billion, equal to 65% of its general fund. In fiscal 2011, Arizona’s budget deficit was 39.0% of its general fund, the third-highest in the nation. In the recent state elections, residents voted on several measures intended to shore up the state’s finances. Voters rejected the continuation of a sales tax hike, while approving the restructuring of the state’s property tax assessment system.

Between 2010 and 2011, New Jersey’s GDP contracted by 0.5%, more than all but three other states. The state’s median household income and poverty rate were both third best in the nation. On the other hand, the state’s tax burden on its residents was second highest in the U.S. in 2010. Residents paid 12.4% of their income in state and local taxes, higher than any other state except New York. The state has many budget problems, as well. New Jersey’s debt as a percentage of revenue was 91.6%, the fifth-highest of all states.

24/7 Wall St. considered data from a number of sources, including Standard & Poor’s, the Bureau of Labor and Statistics, the U.S. Census Bureau, the Tax Foundation, RealtyTrac, The Federal Bureau of Investigation and the National Conference of State Legislators.

Unemployment data was taken from the U.S. Bureau of Labor Statistics. Credit ratings were from ratings agencies S&P and Moody’s. We relied on the FBI’s Uniform Crime Report for violent crime rate by state and large metropolitan areas. RealtyTrac provided foreclosure rates.

A significant amount of the data we used came from the U.S. Census Bureau’s American Community Survey. Data from ACS included percentage of residents below the poverty line, high school completion for those 25 and older, median household income, percentage of the population without health insurance and the change in median home values from 2006 to 2011. These are the values we used in our ranking.

Once we reviewed the sources and compiled the final metrics, we ranked each state based on its performance in all the categories. All data are for the full year 2011, with the exception of debt per capita, obtained from the Tax Foundation, and state budgetary data, which came from the U.S. Census Bureau, and is for fiscal year 2010. New to this year’s study was our more detailed review of state industry for 2011, from the the Bureau of Economic Analysis, exports per capita for 2011, from the Census Bureau, and the 2010 tax burden and the current tax business climate, from the Tax Foundation.