Hawaii is the best state for retirees, according to a 2012 MoneyRates.com analysis.

The Aloha State surprisingly topped the list despite a very high cost of living, thanks to factors like a high senior life expectancy and pleasant climate.

The list reflected several factors that influence the quality of retirement – cost of living, violent crime rates, property tax rates, climate, life expectancy for seniors, recent population growth in the senior demographic and unemployment.

Following Hawaii, Idaho and Utah bagged the second and the third spots respectively. Both the states scored well in the economic and senior-growth population measures.

The group also says Michigan is the worst for seniors, followed by Pennsylvania and Alaska. Weak economic and senior-population figures pushed Pennsylvania onto the worst places list, while Alaska’s crime, climate and economic scores hurt its ranking.

“We recognize that individual tastes vary, so the best state for one person is not going to be the best state for everybody,” said Richard Barrington, CFA, and senior financial analyst at MoneyRates.com, in a statement.

Here are the complete rankings:

The 10 best states for retirement, according to MoneyRates.com’s 2012 study:

1. Hawaii

2. Idaho

3. Utah

4. Arizona

5. Virginia

6. Colorado

7. Florida

7. New Mexico

9. South Dakota

10. California

10. Texas

The 10 worst states for retirement:

 1.  Michigan

2. (tie) Pennsylvania

2. (tie) Alaska

4.  Illinois

5.  Massachusetts

6. (tie) Ohio

6. (tie) New York

8.  Maine

9.  Maryland

10.  Rhode Island