PHOENIX — A personal finance website ranked Scottsdale as one of the three best cities to retire in the U.S.

WalletHub compared 180 cities based on 48 key metrics. The site grouped these data points into four main groups: affordability, activities, quality of life and health care. Scottsdale was No. 3 on the list behind Charleston, South Carolina, and top-ranked Orlando, Florida.

Scottsdale was boosted by its quality of life score, which ranked No. 2 in the country. WalletHub measured this based on metrics including caring community, mild weather and air quality.

Below the four main categories, WalletHub listed other relevant metrics.

Scottsdale had the highest percentage of people aged 65 or older and the fourth-best mild weather ranking.

The East Valley city was also No. 20 in affordability, No. 32 in activities and No. 81 in health care.

Other Arizona cities on the list included Tempe (No. 14), Tucson (No. 30), Gilbert (No. 45), Chandler (No. 59), Phoenix (No. 65), Mesa (No. 68), Peoria (No. 78) and Glendale (No. 102).